HelloWorld
HelloWorld

Reputation: 4349

Devise & Custom Rails User URLs

I am currently using Rails 3.2.5 with the latest devise gem.

Currently users can access their profile page at... example.com/users/john-doe

I want to remove the users portion of the url, so the url would be example.com/john-doe. Is this possible with devise?

Right now in my routes file I have the following...

devise_for :users, :controllers => {:omniauth_callbacks => 'omniauth_callbacks'}

Upvotes: 2

Views: 445

Answers (1)

Nerian
Nerian

Reputation: 16177

Just add a route for it. You will probably want it to be the last one in the routes file.

Something like:

match '/:user' => "users#show", :as => :user_profile

Upvotes: 1

Related Questions