我想在引导程序中以选择样式包装这行ruby,但每次执行它都会中断并列出表单外的所有生成选项。
这里是我要包装的代码
<%= f.label :user_description_id %>
<%= f.collection_select(:user_description_id, UserDescription.all, :id, :description, include_blank: true) %>
答案 0 :(得分:0)
你应该做这件事:
<%= f.label :user_description_id %>
<%= f.collection_select(:user_description_id, UserDescription.all, :id, :description, {include_blank: true}, {class: "css-class"} ) %>