开发者

How to connect the combo box with database fields using ruby on rails 3.0

开发者 https://www.devze.com 2023-03-15 01:17 出处:网络
I am having problem on how to connect the combo box with the fields on the database.. I google it but it seems that luck is not on my side.. I try several code, and I\'m trying to think what is the pr

I am having problem on how to connect the combo box with the fields on the database.. I google it but it seems that luck is not on my side.. I try several code, and I'm trying to think what is the problem wit开发者_运维知识库h my code in _form.html.erb, here it is:

<%= f.select :classification_code, @tests.collect( {|p| [ p.description, p.classification_code ] }, {:include_blank =>'None'}) %>

and I'm having syntax error... how can I do it properly?

thank you.


Try this:

<%= f.select :classification_code, @tests.collect{|p| [ p.description, p.classification_code ] }, {:include_blank =>'None'} %>
0

精彩评论

暂无评论...
验证码 换一张
取 消