Rails 3 :method=> :delete doesn't work in Internet Explorer

前端 未结 11 863
天涯浪人
天涯浪人 2020-12-09 00:44

I am going through the rails 3 tutorial at railstutorial.org. I have just created an extremely simple scaffold Users.

The scaffold-generated destroy link does not wo

11条回答
  •  一整个雨季
    2020-12-09 01:12

    I notice that in rails 4, link_to puts the :method as a html attribute "data-method" but :confirm goes to an attribute "confirm" where the javascript needs it to be "data-confirm".

    Not sure if this is a bug in rails, but you can work around it by doing this:

    <%= link_to 'Destroy', user, :data => {:confirm => 'Are you sure?'}, :method => :delete %>
    

提交回复
热议问题