You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If i use standard config.active_storage.service = :local, i can upload and download a pdf.
But the download broke when i change it to config.active_storage.service = :db.
To download the document, i have this in my show.html.erb page: <%= link_to("Document", rails_blob_path(@person.file, disposition: "attachment")) %>
_form.html.erb: <%= form.file_field :file %>
Controller:
Just added :file to allowed parameters list.
Model: has_one_attached :file
The error i see in terminal is:
Started GET "/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBDQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--85226e56d7362d1f5c786ca289dc03009674c195/railsScaffoldCommand.pdf?disposition=attachment" for ::1 at 2019-04-29 17:45:01 -0300
Processing by ActiveStorage::BlobsController#show as PDF
Parameters: {"disposition"=>"attachment", "signed_id"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBDQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--85226e56d7362d1f5c786ca289dc03009674c195", "filename"=>"railsScaffoldCommand"}
ActiveStorage::Blob Load (0.4ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]]
↳ /home/junior/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98
Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.4ms)
Thanks for your work. I appreciate your effort on this gem.
The text was updated successfully, but these errors were encountered:
You might want to try applying my pull request or my fork (master branch) in case that resolves your issue. The pull request fixes some issues, although I haven't specifically tested for yours.
Hello,
If i use standard
config.active_storage.service = :local
, i can upload and download a pdf.But the download broke when i change it to
config.active_storage.service = :db
.ruby '2.5.1'
gem 'rails', '~> 5.2.3'
gem 'pg', '>= 0.18', '< 2.0'
psql (PostgreSQL) 10.7 (Ubuntu 10.7-1.pgdg18.04+1)
To download the document, i have this in my show.html.erb page:
<%= link_to("Document", rails_blob_path(@person.file, disposition: "attachment")) %>
_form.html.erb:
<%= form.file_field :file %>
Controller:
Just added :file to allowed parameters list.
Model:
has_one_attached :file
The error i see in terminal is:
Started GET "/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBDQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--85226e56d7362d1f5c786ca289dc03009674c195/railsScaffoldCommand.pdf?disposition=attachment" for ::1 at 2019-04-29 17:45:01 -0300
Processing by ActiveStorage::BlobsController#show as PDF
Parameters: {"disposition"=>"attachment", "signed_id"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBDQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--85226e56d7362d1f5c786ca289dc03009674c195", "filename"=>"railsScaffoldCommand"}
ActiveStorage::Blob Load (0.4ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]]
↳ /home/junior/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98
Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.4ms)
Thanks for your work. I appreciate your effort on this gem.
The text was updated successfully, but these errors were encountered: