I use: r.match('/admin').to(:controller => 'admin/sites')
and
r.namespace :admin do |admin|
admin.resources :administrators
admin.resources :writers
admin.resources :sites do |site|
site.resources :writerships
site.resources :templates
site.resources :pages
end
end
Does this help you a bit?
On Thu, Nov 6, 2008 at 10:29 AM, Nicholas Wieland <
[EMAIL PROTECTED]> wrote:
> Hi, I would like a bunch of controllers handling something like an
> administration interface, hidden inside a directory (just to have
> controllers with the same name on controllers/ but that do all the editing
> stuff).
> I tried:
>
> merb-gen controller '/admin/articles'
>
> and it worked as I expected, creating a module Admin with a class Articles
> inside.
> It's all evening I'm trying to route my requests to go in that Articles
> class and call the index action, and damn, I've got no clue.
>
> At this point I have something like
>
> match( "/:module/:controller/:action/:id" ).to( :controller =>
> ":module/:controller" )
>
> I also tried hardcoding everything, like match( "/admin/blabla" ) but
> nothing.
>
> Can someone explain me how does this work ? ...
>
> Should I use a part, a slice ?
>
> Sorry, newbie here.
> I'm having a lot of fun with Merb, thanks a lot guys.
>
> ngw
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---