Follow Along as I Stumble on the Path to Learning RoR

Select Default

To have a default value above the options in a Rails select box, use :prompt.

ie

<%= f.select(:field_name, {“option1″=>”option1″ ,”option2″ =>”option2″}, :prompt=>”Please select an option”) %>

Advertisements

Comments are closed.