Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachments issue causing pop-up error? #450

Open
danstuckey opened this issue Jun 12, 2015 · 0 comments
Open

Attachments issue causing pop-up error? #450

danstuckey opened this issue Jun 12, 2015 · 0 comments
Labels

Comments

@danstuckey
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants