Hi, I''m currently having the admin part of one of my apps accessible by pure username and password + role management checking. I was planning to add namespaces for it. Then I came accross this (a bit old but still...): http://glu.ttono.us/articles/2006/08/30/guide-things-you-shouldnt-be-doing-in-rails "Putting Controllers in Namespaces This is really more trouble than it’s worth. You run into all sorts of crazy errors if you do this and you’ll be confused and frustrated. You’ll then ask other people about it and they’ll either blow you off for using namespaces with controllers or procede to get confused and frustrated as well. Then you’ll say, “I with I had listened to Kevin and Chris”. If you want /admin/some_controller as an URL that’s fine. Use the routing that’s built into rails." I''ve used namespaces for admin before and actually it can create confusion. On the other hand using a common controller with some extra is_admin? checks can be a bit ugly. I know it all depends on how different the admin funcionality is. But is there any opinions/experiences you could share on this issue? Thanks. -- 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 -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2008-Oct-06 22:06 UTC
Re: Namespaces for admin fucntionality, worth the effort?
On Oct 6, 2008, at 1:31 PM, comopasta Gr wrote:> > Hi, > > I''m currently having the admin part of one of my apps accessible by > pure > username and password + role management checking. > > I was planning to add namespaces for it. Then I came accross this (a > bit > old but still...): > http://glu.ttono.us/articles/2006/08/30/guide-things-you-shouldnt-be-doing-in-rails > > "Putting Controllers in Namespaces > > This is really more trouble than it’s worth. You run into all sorts of > crazy errors if you do this and you’ll be confused and frustrated. > You’ll then ask other people about it and they’ll either blow you off > for using namespaces with controllers or procede to get confused and > frustrated as well. Then you’ll say, “I with I had listened to Kevin > and > Chris”. If you want /admin/some_controller as an URL that’s fine. Use > the routing that’s built into rails." > > I''ve used namespaces for admin before and actually it can create > confusion. On the other hand using a common controller with some extra > is_admin? checks can be a bit ugly. I know it all depends on how > different the admin funcionality is. > > But is there any opinions/experiences you could share on this issue?I''ve done it quite a few times... rails 1.1.6, 1.2.3, and several with whatever is current 2.1.1 (?). I haven''t had any problems... -philip --~--~---------~--~----~------------~-------~--~----~ 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 Mon, Oct 6, 2008 at 9:31 PM, comopasta Gr <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''m currently having the admin part of one of my apps accessible by pure > username and password + role management checking. > > I was planning to add namespaces for it. Then I came accross this (a bit > old but still...): > http://glu.ttono.us/articles/2006/08/30/guide-things-you-shouldnt-be-doing-in-railsThat article is very old. I''d recommend namespacing controllers for something like admin panel. It has worked great for me. -- Cheers! - Pratik http://m.onkey.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Oct-07 01:05 UTC
Re: Namespaces for admin fucntionality, worth the effort?
On 7 Oct 2008, at 01:49, Robby Russell wrote:> > On Mon, Oct 6, 2008 at 4:57 PM, Pratik <pratiknaik-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> On Mon, Oct 6, 2008 at 9:31 PM, comopasta Gr >> <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >>> I''m currently having the admin part of one of my apps accessible >>> by pure >>> username and password + role management checking. >>> >>> I was planning to add namespaces for it. Then I came accross this >>> (a bit >>> old but still...): >>> http://glu.ttono.us/articles/2006/08/30/guide-things-you-shouldnt-be-doing-in-rails >> >> That article is very old. I''d recommend namespacing controllers for >> something like admin panel. It has worked great for me. > > > Agreed. We use an /admin namespace on several of our really large > client projects. It works quite well. > > The only issue that we''ve really run into is with namespaces and model > names. Some weird stuff can happen (especially within tests) if you > have a namespace of Admin and a model named Admin. We''ve since used > Administrator to as an appropriate model name to distinguish the two. >Might that be weird stuff like it trying to resolve a constant like Admin::SettingsController by looking inside the Admin model class ? I''ve got apps with /admin namespaced controllers on several apps. Fred> Good luck! > > Cheers, > Robby > > -- > Robby Russell > Chief Evangelist, Partner > > PLANET ARGON, LLC > design // development // hosting > > http://www.planetargon.com/ > http://www.robbyonrails.com/ > aim: planetargon > > +1 503 445 2457 > +1 877 55 ARGON [toll free] > +1 815 642 4068 [fax] > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Joshua Abbott
2008-Oct-07 16:24 UTC
Re: Namespaces for admin fucntionality, worth the effort?
I''ve never had any problems with using an admin namespace either. I recommend doing it. -- Josh http://iammrjoshua.com Frederick Cheung wrote:> On 7 Oct 2008, at 01:49, Robby Russell wrote: > >>>> (a bit >> The only issue that we''ve really run into is with namespaces and model >> names. Some weird stuff can happen (especially within tests) if you >> have a namespace of Admin and a model named Admin. We''ve since used >> Administrator to as an appropriate model name to distinguish the two. >> > Might that be weird stuff like it trying to resolve a constant like > Admin::SettingsController by looking inside the Admin model class ? > > I''ve got apps with /admin namespaced controllers on several apps. > > Fred-- 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 -~----------~----~----~----~------~----~------~--~---
comopasta Gr
2008-Oct-07 21:54 UTC
Re: Namespaces for admin fucntionality, worth the effort?
Hi, Thanks for your comments. I decided to go for the admin namespace, I need to have several controllers under it. Already posted the first problem. The very first command actually :-P Didn''t even have time to get confused :-) http://www.ruby-forum.com/topic/167667 Cheers! -- 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 -~----------~----~----~----~------~----~------~--~---
glennswest
2008-Oct-08 02:06 UTC
Re: Namespaces for admin fucntionality, worth the effort?
Yes, I tend to break each major part of my app, into a namespace. If its a "top" tab on my menu, its a namespace. It make life so much easier. So yes, admin is almost always in every app. Espesially when you start having dozens to hundreds of controllers. Havent quite got to having a "model" in different namespace yet but got close. On Oct 8, 5:54 am, comopasta Gr <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > Thanks for your comments. I decided to go for the admin namespace, I > need to have several controllers under it. > > Already posted the first problem. The very first command actually :-P > Didn''t even have time to get confused :-) > > http://www.ruby-forum.com/topic/167667 > > Cheers! > -- > 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 -~----------~----~----~----~------~----~------~--~---