I am trying to figure out how to use the "select" helper in changing a scaffold produced "new.html.erb" file. Specifically how do I change: <ul>Year In School: <%= f.text_field :year %> </ul> so that this shows up as a "drop down box". I''ve tried different variations of <%= f.select :year %> but that never works. Any help? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
railsfid-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> I am trying to figure out how to use the "select" helper in changing a > <%= f.select :year %> > > but that never works. > Any help?try this <%= f.select :year ,Time.now.year-100..Time.now.year %> -- 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 -~----------~----~----~----~------~----~------~--~---
Nope, that doesn''t work. To clarify, the year part is supposed to be a pull down select menu of "Senior, Junior, Sophomore, Freshman" On Oct 29, 10:11 pm, Thani Ararsu <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> rails...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > I am trying to figure out how to use the "select" helper in changing a > > <%= f.select :year %> > > > but that never works. > > Any help? > > try this > > <%= f.select :year ,Time.now.year-100..Time.now.year %> > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
railsfid-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Nope, that doesn''t work. To clarify, the year part is supposed to be a > pull down select menu of "Senior, Junior, Sophomore, Freshman" > > > On Oct 29, 10:11�pm, Thani Ararsu <rails-mailing-l...@andreas-s.net>what is the error ? post it here. what is your rails version? and try this <%= select :obj,:year ,%w{Senior Junior Sophomore Freshman} %> -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thani Ararsu wrote:> railsfid-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: >> Nope, that doesn''t work. To clarify, the year part is supposed to be a >> pull down select menu of "Senior, Junior, Sophomore, Freshman" >> >> >> On Oct 29, 10:11�pm, Thani Ararsu <rails-mailing-l...@andreas-s.net>post here "new.html.erb" content -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
That did it, thanks On Oct 29, 10:43 pm, Thani Ararsu <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> rails...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > Nope, that doesn''t work. To clarify, the year part is supposed to be a > > pull down select menu of "Senior, Junior, Sophomore, Freshman" > > > On Oct 29, 10:11 pm, Thani Ararsu <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > what is the error ? post it here. > what is your rails version? > > and try this > <%= select :obj,:year ,%w{Senior Junior Sophomore Freshman} %> > > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---