문제

How do I put name and id on a select_tag? I tried this way but i only got syntax error,

 <%= select_tag :product_id, options_from_collection_for_select(Product.order(:name), :id, :name, params[:product_modules][:product_id]), id: "product_modules[product_id]", { include_blank: true } %>

Thanks,

도움이 되었습니까?

해결책

Try this

select_tag "product_modules[product_id]", options_from_collection_for_select(Product.order(:name), :id, :name)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top