Rails Select Tag (Undocumented)

I just spent a half-hour trying to figure out the easiest way to build an HTML select form using the Rails FormBuilder. Various tutorials suggested rendered a partial with a collection, or writing a custom FormBuilder. Its really just this easy though.. give the name and an array of options:


<% form_for @service_account do |f| %>

    <%= f.select :service, [:tumblr, :flickr] %>

<% end %>

posted 1 year ago