NoMethodError with my sessions controller?

Hi All,

Can someone please explain the meaning of the following error:

“NoMethodError (undefined method `+’ for
{:action=>“new”, :controller=>“sessions”}:Hash):”

I have 3 controllers: TEAM, USER, SESSION

If I create a single user from TEAM it works fine, however if I
perform a loop to create multiple USERs, I get the above error. It
makes no sense. The USER model does validation but I make sure that
each iteration changes the specific value. What’s more is I can do it
manually and it works fine. Why would a loop cause the app to flip
out?

Thanks in advance.

On Jun 13, 5:13 pm, gberz3 [email protected] wrote:

Hi All,

Can someone please explain the meaning of the following error:

“NoMethodError (undefined method `+’ for
{:action=>“new”, :controller=>“sessions”}:Hash):”

You called + on something which doesn’t understand +. Hard to say
what’s wrong without seeing what you’ve actually done

Fred

First of all, wow. That was a fast postback. Thank you.

I actually just found the problem. I was assigning the following:

cur_name = (teamname.to_s + j.to_s).to_s
cur_email = curname + “@na.com

…notice the missing underscore in the second assignment. Ruby of
course assigned the value to a hash and then thing went awry. Of
course, it really would have been nice to have a more intuitive
error statement.

Thanks again!

On Jun 13, 12:19 pm, Frederick C. [email protected]