On 20 March 2010 10:08, Colin Law <clan...@googlemail.com> wrote:
> You have
> <td><%=h charge.name %></td>
>
> Where is the variable called charge setup?
>

I think in the cherry-picking of code to put into pastie, an "each"
line was missed out around here:
  <%  charges = params[:charges]
  if charges %>
    <td><%=h charge.name %></td>

But the upshot is; if you are populating "charges" from the params
hash, what is in params? I'd put money on params[:charges] returning
an array of integers that are ids of charges (hence getting "undefined
method `name' for "41":String" as the error). If you want "charges" to
be a collection of Charge objects that match the ids in
params[:charges] - get that all sorted in the controller.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to