Given a complex url, I want to give the user a shortened and nice url. For example, If the user gives me url1, I will return the user a url named www.something.com/some-name.
If the user gives me url2, I will return the user a url named www.something.com/some-other-name. (I will store the provided url and its matching url in the database)
I plan to receive the shortened and find the corresponding url in the database, and redirect the users to the original url. But how should I route the www.something.com/some-name to the correct controller in Ruby on Rails? And How do I add these routes dynamically?