views:

348

answers:

1

is it possible to add an option like :include_blank => 'Please Select' in a method select _ tag like it is posible with the select method? it seems not to work. is there any substitute for this for select _ tag method?

thank you for your answers.

+2  A: 

The select_tag method does not modify the options list you pass it. If you want a blank option you have to include it in your list of options.

If you're using options_for_select your list should start with the blank item, ie: ["Please select", ''].

If you're just passing html to select_tag make sure your first option is:

<option value="">Please Select</option>
EmFi