开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜