I have a question about changeset 355  for "Initial support for
controllers to be nested in modules and directories."

I have probably overlooked something here, but it appears to me that
something is missing to be able to route to those nested controllers.

Looking in Merb::Dispatcher, it looks like the workflow goes like this.

route = route_path(request_uri)
  route_path then calls Merb::Router.match(path)

klass = resolve_controller(route[:controller])
  resolve_controller then splits the controller part of the route with
  segments = controller_name.split('/').map{|s| s.snake_case}

However, it appears that Merb::Router.match isn't handing back "module/class".

For example:

If I setup say an Admin::Articles controller, with an articles
resource, then these are the results of those methods.

route = Merb::Dispatcher.route_path("/admin/articles")
=> {:controller=>"articles", :rest=>true, :allowed=>{:get=>"index",
:post=>"create"}}

Which then resolve_controller gives me:

Merb::Dispatcher.resolve_controller(route[:controller])
=> Articles

However, if I pass it manually like this, it works.

Merb::Dispatcher.resolve_controller("admin/articles")
=> Admin::Articles

Is this a missing piece in Router.match or am I supposed to be setting
up some other type of route in router.rb in order for this to all
work?

Sorry if its obvious, its not jumping out at me right now.

Thanks
Dusty Doris
_______________________________________________
Merb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/merb-devel

Reply via email to