I am trying to do both: call a controller action and react to onclick with a javascript function. At the moment, I only can do one thing. Trying with
<%= button_to 'Call Action', contoller_action_path, :remote => true,
:method => 'post',
:onclick => "setSomeJsState('Run'); return(false);" %>
it triggers only the onclick part.
Any ideas?
Thanks in advance,
devyn
return falsein js event disables event propagation, and thus rails ujs code to handle button does not run.Other option is to make an
$.ajaxcall to the action insetSomeJsStatefunction.