Hi,
I''d like to have a list of things with checkboxes in front of each.
When
(un)checking the checkbox, a method should be invoked and I''d like to
be
able to see a) which checkbox has been changed (best would be a numeric
id) and b) if the checkbox is now on or off.
This is my attempt
<%= start_form_tag({:action => "save"},
:id=>"checkform" ) %>
<%= check_box "checker", "yesno", :id =>
"boxx" %>
<%= submit_tag "save" %>
<%= end_form_tag %>
<%= observe_form "checkform",
:frequency => 1,
:url => { :action => "save" },
:with => "sometext=value"
%>
When I uncheck the checkbox, the action ''save'' is invoked and
the
parameters look like this:
{"commit"=>"save",
"checker"=>{"yesno"=>"0"},
"action"=>"save",
"controller"=>"check"}
(and "yesno" => "1" when checked).
Question: how do I get the id into the parameter list? Would this be the
only way:?
<%= check_box "checker[]", "yesno", :id =>
"boxx" %>
without the strange line ":with =>
''sometext=value''", I won''t get any
useful results, why?
(Parameters: {"action"=>"save",
"controller"=>"check"})
How should I use the observe_form correctly?
Patrick
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---