How to add confirm message with link_to Ruby on rails -
i wanted add confirmation message on link_to function ruby.
= link_to 'reset message', :action=>'reset' ,:confirm=>'are sure?'
any ideas why it's not working?
first, should verify layout have jquery_ujs. best practice including in main application.js:
//= require jquery_ujs
check included application.js in layout:
= javascript_include_tag :application
while, in development mode, view source html , verify jquery_ujs.js exists.
run server , verify link tag has data-confirm value, example:
<a href="/articles/1" data-confirm="are sure?" data-method="delete">
if steps correct, should work!
note: check railscast http://railscasts.com/episodes/136-jquery-ajax-revised
Comments
Post a Comment