Displaying 1 result from an estimated 1 matches for "url_to_hash".
2006 Feb 05
0
is there an inverse of ''url_for''
What I want to do is take a url string (from a file,db,form field,...)
and turn it into a hash.
For example:
string = ''proto://host.com/posts/show/10?user=joe''
url_to_hash(string) #=> {:controller => ''posts'', :action => ''show'', :id
=> 10, :user => ''joe''}
Does rails have anything like this already built in, or a simple way of
doing this?
If not:
How does rails take the url and create the params[...