I am having a problem seaching my Plan object with Plan.find() using
an array object that appears to be setting itself up incorrectly.
Here is what I am seeing.
NoMethodError in Generate reportsController#advanced_plan_summary
Hi!
I think that if what you get is x, you are calling x.each() but x is an
object not an array.
Will wrote:
I am having a problem seaching my Plan object with Plan.find() using
an array object that appears to be setting itself up incorrectly.
Here is what I am seeing.
NoMethodError in Generate reportsController#advanced_plan_summary
I found the problem. You were correct. I kept thinking Ruby was
misformating the parameter straing. Thinking I should see and array
in Parameters: {“plans”=>“3/29”}. This was correct.
@plans = Plan.find(params[:plans])
My problem was with this code
for plan in @plans
…
end
I had to change it to
for plan in @plans.to_a
…
end