How do I set a blank value for an f.select form field

前端 未结 5 1742
花落未央
花落未央 2021-02-01 12:24

I am using the following to allow my users to select their sex in their profile.

<%= f.select (:sex, %w{ Male Female }) %>

How would I c

5条回答
  •  北荒
    北荒 (楼主)
    2021-02-01 12:51

    You go with

    <%= f.select :gender, %w{ Male Female }, :include_blank => true %>
    

提交回复
热议问题