I’ve used he rails engine to create a demo app. Everything works fine, except the “Destroy” function deos not do anything.
There is no error message.
Can anyone guess as to why nothing would happen, even though there is no error message?
The function (auto-created) is:
def destroy
@term = Term.find(params[:id])
@term.destroy
respond_to do |format|
format.html { redirect_to terms_url }
format.json { head :ok }
end
end
and the HTMl part is:
<td><%= link_to 'Destroy', term, confirm: 'Are you sure?', method: :delete %></td>
I dont even get the confirmation question.
Checked, and JavaScript is enabled.
It’s a pretty common question, sounds like you’re not including the javascript that shows the confirmation and implements the delete method across all browsers that don’t support it – did you include the rails javascript libraries?
Rails 3.1
Rails 3
see link_to delete url is not working