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
In our case, when saving (PUT) - there's some reasons that the code also rendered the attachments displaying part :
Started PUT "/accounts/2538" for 75.74.41.20 at 2015-06-11 17:26:49 -0400
Processing by AccountsController#update as /
Parameters: {"utf8"=>"✓", "authenticity_token"=>
....
Rendered accounts/_edit.html.haml (193.8ms)
Rendered /usr/local/rvm/gems/ruby-2.0.0-p451/bundler/gems/ffcrm_attachments-3ef116be21fb/app/views/attachments/_attachments.html.haml (4.6ms)
Rendered /usr/local/rvm/gems/ruby-2.0.0-p451/bundler/gems/ffcrm_attachments-3ef116be21fb/app/views/attachments/_attachments_update.html.haml (4.9ms)
Rendered accounts/update.js.haml (203.4ms)
But this account (id 2538) doesn't have any attachments - why the attachments were attached to it so the code (if entity.attachments.present?) was accepted and then thrown out error:
Looks like the error happened when the code tried to do a "PUT" request on the action "download" of the controller "attachments". But this is designed for "GET" request purpose only ( FYI - https://github.com/crossroads/ffcrm_attachments/blob/master/config/routes.rb).
In our case, when saving (PUT) - there's some reasons that the code also rendered the attachments displaying part :
Started PUT "/accounts/2538" for 75.74.41.20 at 2015-06-11 17:26:49 -0400
Processing by AccountsController#update as /
Parameters: {"utf8"=>"✓", "authenticity_token"=>
....
Rendered accounts/_edit.html.haml (193.8ms)
Rendered /usr/local/rvm/gems/ruby-2.0.0-p451/bundler/gems/ffcrm_attachments-3ef116be21fb/app/views/attachments/_attachments.html.haml (4.6ms)
Rendered /usr/local/rvm/gems/ruby-2.0.0-p451/bundler/gems/ffcrm_attachments-3ef116be21fb/app/views/attachments/_attachments_update.html.haml (4.9ms)
Rendered accounts/update.js.haml (203.4ms)
The _attachments.html.haml only displays attachments when they exist with the condition if entity.attachments.present? at line 10 (FYI,
https://github.com/crossroads/ffcrm_attachments/blob/master/app/views/attachments/_attachments.html.haml)
But this account (id 2538) doesn't have any attachments - why the attachments were attached to it so the code (if entity.attachments.present?) was accepted and then thrown out error:
ActionController::RoutingError (No route matches {:action=>"download", :controller=>"attachments", :id=>#<Attachment id: nil, entity_id: 2538, entity_type: "Account", created_at: nil, updated_at: nil, attachment_file_name: nil, attachment_content_type: nil, attachment_file_size: nil, attachment_updated_at: nil>})
I query the database on the table attachments but can't find any associate records for the entity_id: 2538
The text was updated successfully, but these errors were encountered: