Populating Dropdown SimpleForm

33 views
Skip to first unread message

Simone Battiste-Alleyne

unread,
Jul 22, 2015, 1:59:11 AM7/22/15
to Ruby on Rails: Talk
I'm working on populating this dropdown and finding myself having some trouble even though in theory it would be pretty simple. I'm used to rails 4 and we are using rails 3 on this project as well as haml which I'm familiar with, but not super comfortable with.

_extra_fields.html.haml
= form.input :category_id, as: :select, collection: Category.all.map{|x| [x.name,x.id]}, input_html: {:style => "width:300px"}, :include_blank => true
= form.input :sub_category_id, as: :select, collection: @package.category.sub_categories.map{|x| [x.name,x.id]}, input_html: {:style => "width:300px"}, :include_blank => false


Colin Law

unread,
Jul 22, 2015, 2:12:45 PM7/22/15
to rubyonra...@googlegroups.com
A clue to the problem you are having would be helpful. It can often
be useful to look at the html generated to see how that differs from
what you would expect.

Colin
Reply all
Reply to author
Forward
Message has been deleted
0 new messages