Ask A Question


You’re not receiving notifications from this thread.

Do I have to create a controller for users using Devise or where can I find its actions ?

Damian Nelwep asked in Rails

I'm having some trouble setting up Paperclip gem to setup profile pictures for the users of my app and I need to access users_controller. Since I'm using Devise, I don't really know where I can find it and I guess it's not a really good idea to create users_controller.rb since it may surely get to some conflicts so where should I go to solve this ? It took some time for me to find a way but without success I'll keep on searching anyways. Wishing you a good day/night and thank you so much for the support...


Before you can customize them you need to generate them:

rails generate devise:controllers users

Then for devise to use your generated controllers, you add a controllers option to your routes:

devise_for :users, :controllers => { registrations: 'users/registrations' }


You should generate a users_controller which inherits from application_controllerand define there your custom show method. Don't forget to create a view and routes for it. Ex:


def show
@user = User.find(params[:id])

in your view

<%= %>


match 'users/:id' => 'users#show', via: :get


get 'users/:id' => 'users#show'


resources :users, only: [:show]

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,453+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.