MID
MID

Reputation: 1825

How to add option value = "" in select boxed in Rails?

I want to use jQuery validation plugin for select boxes, but I don't know how to add value ="" in select. Here is my code:

   <%= f.select :language, options_for_select([
       "--- please select ---",
        "Arabic",
        "Chinese"
         ])
        %>

I want to add

    value="" option="please select"

How I can do it in Rails ?

Upvotes: 0

Views: 245

Answers (1)

Harry
Harry

Reputation: 4835

<%= f.select :language, options_for_select([
    "Arabic",
    "Chinese"
     ], {:prompt => "please select"})
    %>

Upvotes: 1

Related Questions