Collection_select

_form.html.haml
= f.label :Select_Brand, “Select_Brand*”.html_safe
= collection_select(:brand_name, :brand_id, Brand.all, :id, :name,
:prompt => “Select a Brand” )

show.html.haml file
%table
%tr
%td
Brand_Name :
%td
= @message.brand_id

After writing this code I am not able to see the brand name. Its not
giving any error but its giving blank field

I don’t think there should be any issue with this syntax then also you
can try this one
f.collection_select(:brand_id, Brand.all, :id, :name,
:include_blank => “Select a Brand” )

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs