I’m trying to make my application work with DELETE action without javascript.
Evrything work as long as my app/view/layout/application.html.haml file do contain the following :
!!! 5
%html
%head
%title My application
= stylesheet_link_tag 'screen', :media => 'screen, print, projection'
/[if IE]
// CSS for IE
= javascript_include_tag 'application'
= csrf_meta_tags
%body
...
If I remove the = javascript_include_tag 'application' instruction. I can no more delete any record.
Rails is instead performing a SHOW action.
Any idea ?
Ryan Bates made a nice RailsCasts episode on this issue: Destroy without JavaScript.
He simply suggests to add an extra GET member route which will lead to the same controller action when JS is disabled.