I''m very new to Rails (1.2) and I''m trying to work something out: I have an AdminController which provides a basic index action and view. I also have a bunch of resources eg. Profiles, etc. these resources utilize the RESTful resource controllers created using the "script/generate scaffold_resource..." generator. Currently I have the following mapping: map.resource :profiles, :path_prefix => "/admin" I''d like to be able to map the resources so they are accessible from /admin only, however, I''m finding I can access the profiles controller from both /profiles and /admin/profiles. I''d like to be able only access the profile controller from admin, and then be able to allow/deny access to actions based on member authentication/authorisation. I''ve read all the posts/articles on nested resources, folder/controller hacks etc (the latter I can''t get to work either), and I don''t seem to be getting anywhere. Can anyone throw some light please? Cheers and thanks in advance. -- 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 -~----------~----~----~----~------~----~------~--~---
On 3/20/07, Dominique Jocubeit <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I''m very new to Rails (1.2) and I''m trying to work something out: > > I have an AdminController which provides a basic index action and view. > I also have a bunch of resources eg. Profiles, etc. these resources > utilize the RESTful resource controllers created using the > "script/generate scaffold_resource..." generator. > > Currently I have the following mapping: > map.resource :profiles, :path_prefix => "/admin" > > I''d like to be able to map the resources so they are accessible from > /admin only, however, I''m finding I can access the profiles controller > from both /profiles and /admin/profiles. I''d like to be able only access > the profile controller from admin, and then be able to allow/deny access > to actions based on member authentication/authorisation. > > I''ve read all the posts/articles on nested resources, folder/controller > hacks etc (the latter I can''t get to work either), and I don''t seem to > be getting anywhere. > > Can anyone throw some light please? > > Cheers and thanks in advance.Do you have the standard map.connect '':controller/:action/:id'' route in there still? -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.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 -~----------~----~----~----~------~----~------~--~---
Rick Olson wrote:> On 3/20/07, Dominique Jocubeit <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> Can anyone throw some light please? >> >> Cheers and thanks in advance. > > Do you have the standard map.connect '':controller/:action/:id'' route > in there still? > > > -- > Rick Olson > http://lighthouseapp.com > http://weblog.techno-weenie.net > http://mephistoblog.comHi Rick, and thanks for the reply. I check out your Lighthouse app the other day and was quite jealous. I was in the process of creating somethign similar as a value add to another web app. It''s very nice. Um, yes I do still have the standard map.connect at the very bottom on the routes file. -- 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 -~----------~----~----~----~------~----~------~--~---
> Hi Rick, and thanks for the reply. I check out your Lighthouse app the > other day and was quite jealous. I was in the process of creating > somethign similar as a value add to another web app. It''s very nice.Thanks.> Um, yes I do still have the standard map.connect at the very bottom on > the routes file.That''s why you can still access it as /profiles. I typically remove this route, as any controllers typically have named routes created for them. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.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 -~----------~----~----~----~------~----~------~--~---
Rick Olson wrote:> That''s why you can still access it as /profiles. I typically remove > this route, as any controllers typically have named routes created for > them.Thanks heaps I''m so grateful because I been mucking around with this for far too long now. 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 -~----------~----~----~----~------~----~------~--~---