Hi,
I''ve got a form like so:
<% @companies.each do |company| %>
<%= company.name %>
<input type="checkbox" name="companies[]"
value="<%= company.id %>" /><br/>
<% end %>
which posts eg. this hash:
*Parameters*: {"commit"=>"Dispatch",
"companies"=>["36", "29", "31",
"34"]}
to this action:
def dispatch
if params[:companies]
params[:companies].each do |key, value|
@company = Company.find(value)
@companies << @company
end
end
I get the error message "Couldn''t find Company without an ID"
help!
Thanks in advance
Adam
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails