ActionController::Routing::Routes.routes[0].requirements[:controller]
end
def get_default_action
ActionController::Routing::Routes.routes[0].requirements[:action]
end
end
end
Is this the best way or is there a more simple / easier way to do
this?
Perhaps you’ve hinted here at your real problem. Are you thinking
that you want to do something like add a ‘class’ attribute to the
link if it’s the current page?
Thanks Philip. But then how do I get the seperate controller and
action from that default method? I need it to add a seperate class to
links with the selected url.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.