sukury47
2010-Nov-18 23:20 UTC
connect Model not to Controller named as pluarize of model but to another Controller
before ask you a my question, i''m not good at english, my description could be awakward;; i''am practicing rails3.0 these days. i''ve desinged RESTful app but there is some question. i''v e made "USER" model and "Login" controller. login controller has ''add_user'' and ''login'' actions and set route.rb up as below resources:users controller =>''login'' but it''s not working as i want to do it doesn''t match localhost:3000/login/user with login/login and match that with user/login what should I do? ps. As i''ve practiced rails, i thought that Controller not named as pluarize of model is bad structure of app is it real? do you think so two? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ar Chron
2010-Nov-19 02:16 UTC
Re: connect Model not to Controller named as pluarize of model but to another Controller
sukury47 wrote in post #962465:> > ps. As i''ve practiced rails, i thought that > Controller not named as pluarize of model is bad structure of app > is it real? do you think so two?Yes, it annoys me that there are so many examples for Rails like that. In Rails, part of the beauty is the idea of convention over configuration. Conform to the 90% case and life (and coding) is easy. Yet so many "introductory" tutorials begin with a non-conforming case. It wasn''t until I really looked at ALL the code generated by a simple rails generate scaffold person first_name:string last_name:string that it all started to make real sense. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Bala Paranj
2010-Nov-19 08:09 UTC
Re: connect Model not to Controller named as pluarize of model but to another Controller
Controller is plural if you want all the RESTful actions including index. It is singular when you don''t need index. Because when a resource is singular there is no need to list them. On Thu, Nov 18, 2010 at 3:20 PM, sukury47 <sukury47-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> before ask you a my question, > i''m not good at english, > my description could be awakward;; > > i''am practicing rails3.0 these days. > i''ve desinged RESTful app > but there is some question. > > i''v e made "USER" model and "Login" controller. > login controller has ''add_user'' and ''login'' actions > > and set route.rb up as below > resources:users controller =>''login'' > > but it''s not working as i want to do > it doesn''t match localhost:3000/login/user with login/login > and match that with user/login > > what should I do? > > ps. As i''ve practiced rails, i thought that > Controller not named as pluarize of model is bad structure of app > is it real? do you think so two? > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Cheers, Bala RoR Developer Now Available for Hire -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.