how to specify label for select in simpleform rails

我们两清 提交于 2019-12-04 16:05:46

问题


<%= f.association :opportunity_status, :label => "Status", :input_html => {} %>
<%= f.select :source_type, options_for_select(["lead","vteam"],["lead"]) %>

On first line every thing is OK. On second line if I attach label the way I did in first line it show an error.

How can I specify label for select using simpleform?


回答1:


This is because f.select is not a simple_form method and does not support :label

This should work for you w/ simple form

<%= f.input :source_type, :label => "Lead or VTeam", :collection => ["lead","vteam"], :selected => "lead" %>

Hope this helps



来源:https://stackoverflow.com/questions/5242289/how-to-specify-label-for-select-in-simpleform-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!