表单: RailsNotes
用户: dreamable
创建日期: 2023-05-10 01:51:37 UTC
更新日期: 2023-05-10 01:51:37 UTC
引用:(Table ID 3, Record ID 55)

标题 :
Rails select with html options.
笔记 :

must put an empty option if want to use html options, e.g. class.

    # class won't work. 
    <%= form.select:status, User.statuses.keys.to_a, class:'form-control col'%> 
    # works
    <%= form.select:status, User.statuses.keys.to_a, {},class:'form-control col'%>
标签: