Ivan V. wrote:> Hi,
>
> I''m trying to find something in ActionController::Routing that can
help
> me find out which controller and action are responsible for a certain
> URL.
>
> So far it seems something like this might be an answer:
>
> request, response = ActionController::CgiRequest.new(cgi,
> session_options),
> ActionController::CgiResponse.new(cgi)
>
> controller = ActionController::Routing::Routes.recognize(request)
>
> But how would I build the cgi and session_options parameters?
>
> Is there a simpler way?
>
> Thanks.
>
> - Ivan V.
Yeah, much simpler:
ActionController::Routing::Routes.recognize_path(path)
That returns a hash with the controller and action names.
This will do wonders for my authentication system!
I hope this is useful to somebody else besides me.
- Ivan V.
PS: NetBeans 6 debugging rocks. Try it if you haven''t already.
--
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
-~----------~----~----~----~------~----~------~--~---