Displaying 2 results from an estimated 2 matches for "get_articl".
Did you mean:
get_article
2006 Jan 04
3
How Can I solve this?
this may be an easy question, but i am unable to solve it:
i want to take the selected choice and process it in the controller:
TEMPLATE:
<%=start_form_tag :action => ''get_article'' %>
<select name=pricelist>
<%= options_from_collection_for_select (@customers, "id", "name") %>
</select>
<%= submit_tag "Get" %>
<%= end_form_tag %>
CONTROLLER:
def get_article
@pricelist=Pricelist.find(??)
@articles...
2006 Jan 03
1
options_from_collection_for_select - NIL Object
...he error occured while evaluating nil.inject
but @customers is not empty ->
def get_customer
@customers=Customer.find_all
end
i have tested it and also the attributes "id" and "name" are existing!!
<h1> xy </h1>
<%=start_form_tag :action => ''get_article'' %>
<select name=xy>
<%= options_from_collection_for_select (@customers, "id", "name") %>
</select>
<%= submit_tag "Get" %>
<%= end_form_tag %>
--
Posted via http://www.ruby-forum.com/.