Completely dead end on this subject, as I believe it is using the correct setting, but I cannot delete my list.
I have the following:
Controller:
def destroy @list = List.find(params[:id]) @list.destroy redirect_to lists_path end
Index.html.haml
- @list.each do |list| ... = link_to "Delete", list_path(list), method: :delete, data: { confirm: 'Are you certain you want to delete this?' } ...
Routes:
ListApp::Application.routes.draw do devise_for :users resources :lists
What gives the correct exit route routes:
lists GET /lists(.:format) lists#index POST /lists(.:format) lists#create new_list GET /lists/new(.:format) lists#new edit_list GET /lists/:id/edit(.:format) lists#edit list GET /lists/:id(.:format) lists
But I still get the following error when working in a production environment.
I, [2013-09-10T15:27:40.338022 #453] INFO -- : Started GET "/lists/2" for 81.159.35.212 at 2013-09-10 15:27:40 +0000 I, [2013-09-10T15:27:40.340626 #453] INFO -- : Processing by ListsController#show as HTML I, [2013-09-10T15:27:40.340867 #453] INFO -- : Parameters: {"id"=>"2"} I, [2013-09-10T15:27:40.354092 #453] INFO -- : Completed 500 Internal Server Error in 13ms F, [2013-09-10T15:27:40.359807 #453] FATAL -- : NameError (undefined local variable or method `list' for #<ListsController:0x000000050a7c38>): app/controllers/lists_controller.rb:38:in `show'
If anyone knows what might cause this, any help would be greatly appreciated :)
source share