Hi anybody please give me example to write select_tag with id, name and options, :note => here id and name of my select tag are different. Regards and Thanks in advance Manoj. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 31 January 2013 11:41, manoj c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi anybody please give me example to write select_tag with id, name and > options, > :note => here id and name of my select tag are different.First have a look at the docs and then come back with your best atempt and explain what does not work about it. However, are you sure you want to use select_tag rather than using form_for and f.select? There are occasions when using form_tag and select_tag is appropriate but if possible then use form_for. If you have not already done so then work right through a tutorial such as railstutorial.org which is free to use online and will show you the basics of rails. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
yes i meant select_tag only like below example <%=select_tag "people", "<option>David</option>".html_safe%> But here name and id of select_tag is same(people), i want to know how to give it seprately Thanks Manoj. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 31 January 2013 11:56, manoj c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> yes i meant select_tag only like below example > <%=select_tag "people", "<option>David</option>".html_safe%> > > But here name and id of select_tag is same(people), i want to know how > to give it sepratelyOK, I understand. I don''t know of a way to do that. Why do you need it? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Colin Law wrote in post #1094550:> On 31 January 2013 11:56, manoj c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> yes i meant select_tag only like below example >> <%=select_tag "people", "<option>David</option>".html_safe%> >> >> But here name and id of select_tag is same(people), i want to know how >> to give it seprately > > OK, I understand. I don''t know of a way to do that. Why do you need > it? > > Colin:( ok its a need now as to do some operation in ajax -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
manoj c. wrote in post #1094553:> Colin Law wrote in post #1094550: >> On 31 January 2013 11:56, manoj c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> yes i meant select_tag only like below example >>> <%=select_tag "people", "<option>David</option>".html_safe%> >>> >>> But here name and id of select_tag is same(people), i want to know how >>> to give it seprately >> >> OK, I understand. I don''t know of a way to do that. Why do you need >> it? >> >> Colin > > :( ok its a need now as to do some operation in ajaxHi colin, we can name to select _tag in rails 3 like, <%=select_tag "people", "<option>David</option>".html_safe,{:name=>{''sample''}}%> -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.