If I have a Users model, and then an individual user, say, person1, is there a way to have the url: www.myapp.com/person1 show what www.myapp.com/users/person1 would? What would that be called?
Thank you!
You should define a route in your routes.rb file:
match "/:user" => "users#show"
and you'll get the username given in params[:user]. But you need to know that this kind of route could override other routes defined, because it will match any string, so you should at least define some constraints on the username.
For example if your usernames matches a regexp you could define it as a constraint
match "/:user" => "users#show", :constraints => { :user => /some-regexp/ }
and don't forget to set this route as the last one in your routes file, otherwise it will clash for sure with other routes.
Read this for full reference
http://guides.rubyonrails.org/routing.htmlAlso, your implementation will be a bit ambiguous, for example, what if user has a usernameusers? or username that is equal to one of model names in your application?