Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Feb 11, 2020
1 parent 994bda3 commit 9854396
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/bookys_controller.rb
Expand Up @@ -5,11 +5,11 @@ def new
def create
pdf = params[:pdf]
basename = File.basename(pdf.path)
Dir.chdir('/tmp')
`/usr/chee/projects/booky/make-booky #{basename}`
File.open("/tmp/#{basename}.booky.pdf") do |file|
puts file
send_data file.read.force_encoding('BINARY'), filename: "#{pdf.original_filename}.booky.pdf", type: 'application/pdf', disposition: 'attachment'
Dir.mktmpdir do |dir|
`/bin/make-booky #{pdf.path}`
File.open("#{basename}.booky.pdf") do |file|
send_data file.read.force_encoding('BINARY'), filename: "#{pdf.original_filename}.booky.pdf", type: 'application/pdf', disposition: 'attachment'
end
end
end
end
3 changes: 3 additions & 0 deletions config/environments/production.rb
Expand Up @@ -109,4 +109,7 @@
# config.active_record.database_selector = { delay: 2.seconds }
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
config.hosts << "booky.snoot.club"
config.serve_static_assets = true
config.public_file_server.enabled = true
end

0 comments on commit 9854396

Please sign in to comment.