I want to have a button which goes to a random user on my site. I am using the friendly_id
gem so the URLs are, for example, /users/dean
and I've also set it up so its /dean
.
I'm guessing I would add something similar to this in my routes.rb
file:
match '/users/random' => 'users#index'
And then some extra code in the user controller?
How would I go about doing this?
Many thanks.