
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 2.00 KB | hits: 8 | expires: Never
Everything works fine when I delete one or more files, I have a problem when no files are deleted and the submit button is pushed and no params is passed. I get the following error from the chrome debugging tools:
POST http://localhost:3000/destroy_multiple?method=Delete 500 (Internal Server Error)
here is the text from the console when submitted and error occurs:
Started POST "/destroy_multiple?method=Delete" for 127.0.0.1 at 2011-08-01 17:35:56 -0500
Processing by PaintingsController#destroy_multiple as JS
Parameters: {"utf8"=>"✓", "authenticity_token"=>"gGnMbFpv93l15myCPWzFKVf6GprKjJy1ALcThoG7FRA=", "commit"=>"Delete", "method"=>"Delete"}
Rendered paintings/_managefiles_files.html.erb (1.5ms)
Rendered paintings/destroy_multiple.js.erb (2.7ms)
Completed in 11ms
ActionView::Template::Error (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.empty?):
26: });
27: </script>
28: <%= form_tag({:controller => "paintings", :action => "destroy_multiple", :method => "Delete"}, { :remote => true }) %>
29: <% if @folder.empty? %>
30: <div id = "empty">NO Files Uploaded Yet!<br />Click <a href = "/uploadfiles">here</a> to upload files </div>
31: <% else %>
32: <div id = "foldercontainer">
app/views/paintings/_managefiles_files.html.erb:29:in `_app_views_paintings__managefiles_files_html_erb__283932883_91149890_11796808'
app/views/paintings/destroy_multiple.js.erb:1:in `_app_views_paintings_destroy_multiple_js_erb__950045845_91165200_387351126'
Rendered /home/rhino/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.1ms)
Rendered /home/rhino/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (4.0ms)
Rendered /home/rhino/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (8.5ms)