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

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -