Hello! I just read DHH''s presentation pdf. In his examples, he wrote PeopleController instead of PersonController. I''ve been using singular words in controller''s name. Which is more common? Thanks. Sam -- Posted via http://www.ruby-forum.com/.
Its always made more sense to use plurals to me. On 6/29/06, Sam Kong <sam.s.kong@gmail.com> wrote:> Hello! > > I just read DHH''s presentation pdf. > In his examples, he wrote PeopleController instead of PersonController. > I''ve been using singular words in controller''s name. > Which is more common? > > Thanks. > Sam > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers, Luke Redpath http://www.lukeredpath.co.uk http://opensource.agileevolved.com
Luke Redpath wrote:> Its always made more sense to use plurals to me.May I ask why? I''m neutral and just want to gather opinions and will stick to the right one. Sam -- Posted via http://www.ruby-forum.com/.
On Friday, June 30, 2006, at 12:55 AM, Sam Kong wrote:>Luke Redpath wrote: >> Its always made more sense to use plurals to me. > >May I ask why? >I''m neutral and just want to gather opinions and will stick to the right >one. > >Sam > >-- >Posted via http://www.ruby-forum.com/. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railsWith a plural controller name you end up with URLs like this... http://localhost/people/edit/1 with singular ones it looks like this.... http://localhost/person/edit/1 The second seems marginally better to me. In particular you need to be consistent if you use controllers from plugins (like the user_engine). _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
Kevin Olbrich wrote:> With a plural controller name you end up with URLs like this... > > http://localhost/people/edit/1 > > with singular ones it looks like this.... > > http://localhost/person/edit/1 > > The second seems marginally better to me. In particular you need to be > consistent if you use controllers from plugins (like the user_engine).I thought so, too. But if the father of Rails takes the other way, it''s really hard to ignore. I think that there should be some concensus about this. Sam -- Posted via http://www.ruby-forum.com/.
If you want to expose your application''s resources using Rails'' upcoming (in 1.2, I believe) RESTy features, DHH''s recommendation to pluralize your controller names will probably have significant benefits in terms of becoming convention. If you don''t care about RESTful behaviour or producing a Web API for your app then just use whatever suits your particular application. - james On 6/30/06, Sam Kong <sam.s.kong@gmail.com> wrote:> Kevin Olbrich wrote: > > > With a plural controller name you end up with URLs like this... > > > > http://localhost/people/edit/1 > > > > with singular ones it looks like this.... > > > > http://localhost/person/edit/1 > > > > The second seems marginally better to me. In particular you need to be > > consistent if you use controllers from plugins (like the user_engine). > > I thought so, too. > But if the father of Rails takes the other way, it''s really hard to > ignore. > I think that there should be some concensus about this. > > Sam > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- * J * ~
I never personally liked using same name in model and controllers. also, when you need to train your team on rails and then get your projects out quickly(some people always have too many questions :) ) I generally used other names like Manageuser instead of User or Users, cms over article. I still use whiteboards for team meetings and lots of paper for UI and prototype, maybe this style suits me regards A.Senthil Nayagam http://senthilnayagam.com Sam Kong wrote:> Hello! > > I just read DHH''s presentation pdf. > In his examples, he wrote PeopleController instead of PersonController. > I''ve been using singular words in controller''s name. > Which is more common? > > Thanks. > Sam-- Posted via http://www.ruby-forum.com/.