I have controller destroy method
def destroy
@category = Category.find(params[:id])
@category.destroy
redirect_to backend_categories_path
end
and in view two different destroying links
<%= link_to 'Destroy', backend_category_path(category), method: :delete, data: { confirm: 'Are you sure?' } %>
<%= button_to 'Destroy', backend_category_path(category), :confirm => "are you sure?", :method => :delete %>
problems are:
- 1st link doesnt work, it shows record not delete
- 2nd link does work but dont ask me if i really want to delete record.
jquery gem is installed whats problem ?
rails version is 3.2.13