I’m very new to Rails so here goes:
I know how to make a basic for that sends the results to another page with
<%= form_tag "Class/Action">
# and
<% submit_tag "Button name">
but what I want are a few buttons that run an action (and the page the user is on doesn’t change or refresh).
Also, if you have a better alternative, here’s exactly what I’m doing: A user is presented with choices and when he selects one, I want to push the choice to other clients via Juggernaut. Juggernaut is used through Rails with the command Juggernaut.publish(channel, message), and so I need to call an action that does this command, without refreshing or changing his page.
Use a
:remote => trueform and run the action via Ajax. This also gives you an easy opportunity to return either data, HTML, or JavaScript to let the user know what happened.