im trying to call a function through onclick method of a button. here is the code:
<%= button_to "Close" , :onclick => "show_back(), return false" %>
but it doesn't work, everytime i click the button an error occours
" No action responded to 29. Actions: checkout, create, destroy, edit, find_cart, index, new, save_order, show, and update "
how ever when i impliment the same thing in a href it works
<a onclick="show_back();return false;" href="#."> Close </a>
can anyone plz tell me what im doing wrong, thanks in advance..
you can try this
and add your class, if you use like bootstrap, you can try:
This worked for me. the key was realizing that it has to be the html_options hash
I was looking for something similar. My problem was that I wanted to fire an addCookie() function when a user click logged in.
Did that with: