This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#app/views/businesses/_form.html.erb | |
<%= form_with(model: business, scope: :business, local: true, :html => {multipart: true}) do |form| %> | |
<div class="row"> | |
<div class="col-md-12"> | |
<%= form.file_field :logo_image, id: :business_logo_image %> | |
<%= form.label :logo_image, class: 'upload' do %> | |
<i class="material-icons">file_upload</i> | |
<span>Choose image</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'pdf-reader' | |
Dir.glob("/Users/mike/Desktop/zip/**/*").each do |pdf| | |
next if pdf == '.' or pdf == '..' or pdf == '.DS_Store' | |
if File.file?(pdf) | |
reader = PDF::Reader.new(pdf) | |
puts (pdf + "," + reader.page_count.to_s) |