Hey, I''m currently reading "Agile Web Development" and doing the tutorial (Depot). It says that the naming conventions are that the Controller needs to be singular (even though I found other naming conventions on the net, anybody knows the official naming conventions?) therefore I have a UserController. When I try to test the controller I get this error: NameError: uninitialized constant UsersController right here: assert_redirected_to user_path Why does it want a UsersController? I thought singular is the way to go? Confused. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I think it is models are singular eg User model ...and controllers are plural: users controller Are you sure you read it right? DAZ On Dec 21, 5:15 pm, Heinz Strunk <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hey, > > I''m currently reading "Agile Web Development" and doing the tutorial > (Depot). It says that the naming conventions are that the Controller > needs to be singular (even though I found other naming conventions on > the net, anybody knows the official naming conventions?) therefore I > have a UserController. When I try to test the controller I get this > error: > NameError: uninitialized constant UsersController > right here: > assert_redirected_to user_path > > Why does it want a UsersController? I thought singular is the way to go? > Confused. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
DAZ wrote:> I think it is models are singular > eg > User model > > ...and controllers are plural: > users controller > > Are you sure you read it right? > > DAZ > > On Dec 21, 5:15�pm, Heinz Strunk <rails-mailing-l...-ARtvInVfO7m5VldFQK4jKA@public.gmane.orgt>Yep, pretty sure: "Rails assumes the class is called StoreController and that it’s in a file named store_controller.rb in the app/controllers directory." So 100% plural? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Some resources you''ll want singular controllers for, like session management. Others you''ll want plural controllers for, like forums, topics, posts and users. Think about how many items you''re dealing with at a time and then let that dictate how your controllers are named. ----- Ryan Bigg Freelancer http://frozenplague.net On 22/12/2008, at 12:36 PM, Heinz Strunk wrote:> > DAZ wrote: >> I think it is models are singular >> eg >> User model >> >> ...and controllers are plural: >> users controller >> >> Are you sure you read it right? >> >> DAZ >> >> On Dec 21, 5:15�pm, Heinz Strunk <rails-mailing-l...@andreas-s.net> > > Yep, pretty sure: > "Rails assumes the class is called StoreController and that it’s in > a > file > named store_controller.rb in the app/controllers directory." > > So 100% plural? > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Dec 21, 12:15 pm, Heinz Strunk <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hey, > > I''m currently reading "Agile Web Development" and doing the tutorial > (Depot). It says that the naming conventions are that the Controller > needs to be singular[...] Controller names should generally be plural in Rails 2; see http://giantrobots.thoughtbot.com/2008/1/8/rails-2-0-routing-changes . Best, -- Marnen Laibow-Koser marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org http://www.marnen.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Alright, thanks guys! A lot of editing is waiting for me now... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---