views:

147

answers:

1

I have form that has :prompt => "Select" on many inputs:

f.select :country, :prompt => "Select"
f.select :city, :prompt => "Select"
...

Is there a way to wrap this using with_options and DRY it up?

+1  A: 

This should work :)

f.with_options :prompt => "Select" do |form|
  form.select :country
  form.select :city
end
Rishav Rastogi
Easy as pie! Thanks dude!
Gavin