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. --~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jun 13, 5:13 pm, gberz3 <gbe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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> 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.--~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jun 13, 5:13 pm, gberz3 <gbe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 > > > 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.--~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---