html - I'm using button_to with :confirm in my html_options, but no confirmation dialog is appearing (in FF & Chrome) -
i'm creating button this:
<%= button_to "remove", { :controller => 'notes', :action => 'destroy', :note_id => @note.id },:confirm => "are sure?" %>
this output:
<form method="post" action="/notes/destroy?note_id=436" class="button_to"><div><input data-confirm="are sure?" type="submit" value="remove" /><input name="authenticity_token" type="hidden" value="zofuwrh9pllfy+2uqv2qmc9ym20oij3e1zvw/wel/q8=" /></div></form>
the button works fine except there's no confirmation popup when button clicked. doing wrong? reading.
are using rails 3.0 or above? if include javascript files - in header:
<%= javascript_include_tag :defaults %> <%= csrf_meta_tag %>
here walk-through:
http://www.simonecarletti.com/blog/2010/06/unobtrusive-javascript-in-rails-3/
Comments
Post a Comment