Forum: Ruby on Rails NoMethodError for select_tag

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ec8b325dcad37dee7a0c358811353a80?d=identicon&s=25 (Guest)
on 2009-03-11 10:54
(Received via mailing list)
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| [,]}, @album.artist_id))
%> (Old artist info:<%= @album.artist_old%>)


undefined method `select_tag' for #<ActionView::Helpers::FormBuilder:

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?
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-03-11 10:56
(Received via mailing list)
On Mar 11, 3:06 am, "" <> wrote:
> undefined method `select_tag' for #<ActionView::Helpers::FormBuilder:
> 0x21f86f8>

select_tag just doesn't exist as a method on form builder. Either use / f.collection_select or use a bare select_tag.

This topic is locked and can not be replied to.