Tom DeHart
2011-May-01 13:11 UTC
Can''t figure out how to submit specific data with javascript
I''m unable to figure out how to submit specific data to a Rails
update()
method via the jQuery submit() method. This is the code snippet I''m
working with:
<% form_for(vote, :remote => true) do |f| %>
<%= check_box_tag "selection", vote.id %>
<% end %>
...
<%= link_to ''Vote Yes'', ballots_path, :onclick =>
"$(''.edit_vote'').submit()" %>
<%= link_to ''Vote No'', ballots_path, :onclick =>
"$(''.edit_vote'').submit()" %>
How do I use the jQuery submit method to submit specific data to the
Vote controller update method? (for example if I press "Vote Yes" then
it submits ":approval => true" so that I can use params[:approval]
to
update the particular vote)
Am I even on the right track?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.