iCyborg
iCyborg

Reputation: 4728

How to have dropdown in simple_form_for with options?

I was using form_for till now and was having this code

<%= f.select :name, options_for_select(%w[Mike Nick Jason Tim]) %>

but what is the equivalent of this in simple_form_for ? I looked at the github doc of simple_form_for but they have not covered this

Thanks

Upvotes: 3

Views: 6184

Answers (1)

dimuch
dimuch

Reputation: 12818

The doc covers this topic, take a look at Collections section

<%= f.input :name, :collection => %w[Mike Nick Jason Tim] %>

Upvotes: 10

Related Questions