How do i show only the check items of a checkbox from a list?, so in
show_select page shows only the yes selected checkbox. i have the
agilewebdevelopment rails book but still can''t understand the checkbox
code.
In view i have this
<%= start_form_tag :action => ''show_select'' %>
<% for request in @requests%>
<%= request.name %>
<%= check_box (''print'', request.id, {}, "yes",
"no" ) %>
<%end%>
<%= submit_tag ''Show'' %>
<%= end_form_tag %>
--
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
-~----------~----~----~----~------~----~------~--~---
Nic __ wrote:> How do i show only the check items of a checkbox from a list?, so in > show_select page shows only the yes selected checkbox. i have the > agilewebdevelopment rails book but still can''t understand the checkbox > code. > > In view i have this > <%= start_form_tag :action => ''show_select'' %> > <% for request in @requests%> > <%= request.name %> > <%= check_box (''print'', request.id, {}, "yes", "no" ) %> > <%end%> > <%= submit_tag ''Show'' %> > <%= end_form_tag %>Hi Nic, So with forms, there are two completely different ways to do them, and you''ve made a common mistake by mixing the two in the code you''ve provided. If you start your form with "start_form_tag", you want to use calls inside that end with "_tag", so in your case, you should be using "check_box_tag" instead of check_box. Alternatively, you could start the form with "form", and use check_box. hth, jp -- 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 -~----------~----~----~----~------~----~------~--~---
Thank you for replying, sorry but i still don''t understand the code to show name on selected checkbox in show_select page. could you give an example. -- 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 -~----------~----~----~----~------~----~------~--~---
Nic __ wrote:> How do i show only the check items of a checkbox from a list?, so in > show_select page shows only the yes selected checkbox. i have the > agilewebdevelopment rails book but still can''t understand the checkbox > code. > > In view i have this > <%= start_form_tag :action => ''show_select'' %> > <% for request in @requests%> > <%= request.name %> > <%= check_box (''print'', request.id, {}, "yes", "no" ) %> > <%end%> > <%= submit_tag ''Show'' %> > <%= end_form_tag %>view: <% for order in @orders %> <%= check_box_tag ''orders[]'', order.id.to_s %> <% end %> controller: @orders = Order.find(params[:orders]) -- 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 -~----------~----~----~----~------~----~------~--~---
Thank you Francis Sinson. That worked. -- 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 -~----------~----~----~----~------~----~------~--~---