bradwrage-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Mar-11 03:06 UTC
NoMethodError for select_tag
Hello there. I am following a tutorial with rails 2.1 and I have come
across a problem where
<%= f.label :artist_id %><br />
<%= f.select_tag(:artist_id, options_for_select([[''choose
one'',
'''']] + @artists.collect {|art| [art.name, art.id]},
@album.artist_id))
%> (Old artist info:<%= @album.artist_old%>)
gives
undefined method `select_tag'' for
#<ActionView::Helpers::FormBuilder:
0x21f86f8>
however, when I just do a select, I can get a drop down menu that is
just much uglier
<option value =3>Coldplay</option> ect...
Any suggestions?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
On Mar 11, 3:06 am, "bradwr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <bradwr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello there. I am following a tutorial with rails 2.1 and I have come > across a problem where > > <%= f.label :artist_id %><br /> > <%= f.select_tag(:artist_id, options_for_select([[''choose one'', > '''']] + @artists.collect {|art| [art.name, art.id]}, @album.artist_id)) > %> (Old artist info:<%= @album.artist_old%>) > > gives > > undefined method `select_tag'' for #<ActionView::Helpers::FormBuilder: > 0x21f86f8> >select_tag just doesn''t exist as a method on form builder. Either use f.select / f.collection_select or use a bare select_tag. Fred> however, when I just do a select, I can get a drop down menu that is > just much uglier > <option value =3>Coldplay</option> ect... > > Any suggestions?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---