<% f.fields_for :keys do |key_form| %> <%= check_box_tag "keys_to_update[]", key_form.object.id %> <%= key_form.label :name, key_form.object.name %> <% end %> This is the output: <input id="keys_to_update_" name="keys_to_update[]" type="checkbox" value="4" /> <input id="keys_to_update_" name="keys_to_update[]" type="checkbox" value="5" /> I try to use cucumber and check only one of them (or all of them) but need an id. Thanks! -- 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.
what about key_form.id? On Apr 19, 3:19 pm, oren <orengo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> <% f.fields_for :keys do |key_form| %> > <%= check_box_tag "keys_to_update[]", key_form.object.id %> > <%= key_form.label :name, key_form.object.name %> > <% end %> > > This is the output: > > <input id="keys_to_update_" name="keys_to_update[]" type="checkbox" > value="4" /> > <input id="keys_to_update_" name="keys_to_update[]" type="checkbox" > value="5" /> > > I try to use cucumber and check only one of them (or all of them) but > need an id. > > Thanks! > > -- > 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@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Apr 19, 9:19 pm, oren <orengo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This is the output: > > <input id="keys_to_update_" name="keys_to_update[]" type="checkbox" > value="4" /> > <input id="keys_to_update_" name="keys_to_update[]" type="checkbox" > value="5" /> > > I try to use cucumber and check only one of them (or all of them) but > need an id. >You can override the automatically generated id with anything of your choice (the last argument to check_box_tag is a hash of html options Fred> Thanks! > > -- > 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@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
works, thank you! On Apr 19, 10:32 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Apr 19, 9:19 pm, oren <orengo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > This is the output: > > > <input id="keys_to_update_" name="keys_to_update[]" type="checkbox" > > value="4" /> > > <input id="keys_to_update_" name="keys_to_update[]" type="checkbox" > > value="5" /> > > > I try to use cucumber and check only one of them (or all of them) but > > need an id. > > You can override the automatically generated id with anything of your > choice (the last argument to check_box_tag is a hash of html options > > Fred > > > Thanks! > > > -- > > 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 athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.