Prompt in select_tag

后端 未结 4 652
醉话见心
醉话见心 2021-02-07 07:31

In my application in user registration I have a country picker..

<%= select(:user, :country, options_for_select(@COUNTRIES)) %>

And I wan

4条回答
  •  甜味超标
    2021-02-07 08:18

    Use the FormHelper :prompt

    select(:user, :country, options_for_select(@COUNTRIES), {:prompt => "--select county--"})
    

    http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper

提交回复
热议问题