Skip to content

Instantly share code, notes, and snippets.

@johnhamelink
Forked from anonymous/gist:5845719
Created June 23, 2013 17:02
Show Gist options
  • Save johnhamelink/5845725 to your computer and use it in GitHub Desktop.
Save johnhamelink/5845725 to your computer and use it in GitHub Desktop.
No route matches {:controller=>"users/cms", :action=>"neighbourhood_attractions_destroy"}
- <td><%= link_to 'Destroy', cms_neighbourhood_attractions_delete_path(:id => attraction.id), method: :delete, data: { confirm: 'Are you sure?' } %></td>
-------------------------------
routes.rb:
delete "admin/neighbourhood_attractions/delete/:id" => "users/cms#neighbourhood_attractions_destroy", :as => :cms_neighbourhood_attractions_delete
----------------------------------
users/cms_controller.rb:
def neighbourhood_attractions_destroy
NeighbourhoodAttraction.destroy(params[:id])
redirect_to :action => "neighbourhood_attractions_index", notice: 'Neighbourhood attraction was successfully deleted.'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment