I am looking for method for parsing route path like this:
ActionController::Routing.new(\"post_path\").parse
#=> {:controller => \"posts\", :action =&g
There's this method:
>> ActionController::Routing::Routes.recognize_path("/posts/")
=> {:action=>"index", :controller=>"posts"}
If you only have a string with your route (like "posts_path"
), then I guess in the context you're using this you should be able to do
ActionController::Routing::Routes.recognize_path(send("posts_path".to_sym))
btw this was educating for me too :)