Get name of nesting controller in route

If I have nested resources:

map.resources ‘projects’ do |project|
project.resources ‘members’
end

When I send a request to /projects/1/members/, I can find my
controller name in my helper by calling:

controller.controller_name
=> “members”

Is there a clean way to find the controller name for the part of the
request_uri that refers to ‘projects’ or deeper nesting? I’m working
around this by parsing the uri string, but I’d like to know how I’d
handle this when the controller name doesn’t match the name of the
route.

–Andrew

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs