On 22 July 2015 at 02:01, Simone Battiste-Alleyne <softe1...@gmail.com> wrote:
> 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

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

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsbu0g7c6Kf8UxTrJupMo%3Dx_V-3G2T6ufR3pB6%3DMKWTug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to