Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to specify label for select in simpleform rails

<%= 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?

like image 525
Syed Raza Avatar asked Mar 09 '11 06:03

Syed Raza


1 Answers

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

like image 193
Mike Vormwald Avatar answered Sep 28 '22 02:09

Mike Vormwald