ruby下拉列表出问题,该如何实现?
我从一个kinds表中取类型名称来对article归类,以kin_id字段在articles表中存储,但出现如下问题:
Showing app/views/articleadmin/_form.rhtml where line #8 raised:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.inject
Extracted source (around line #8):
5: <%= text_field 'article', 'title' %></p>
6:
7: <p><label for="kind_name">分类</label><br/>
8: <select name="kin_id"><%= options_from_collection_for_select(@kinds,'id','name')%></select></p>
9:
10: <p><label for="article_content">内容</label><br/>
11: <%= text_area 'article', 'content','cols'=>40,'rows'=>8 %></p>
该如何解决?
完完整整的下拉列表又该是如何做的?
希望达人帮忙一下!!!