Reputation: 8729
I'm using devise
gem. So, I can easily edit current user account by generating devise views
. I've already a model user
and it's related to devise
gem for authenticating purpose. Now, I want to show user profile
or user information
in a single page. I can do it by creating a new controller. But, is it efficient or recommended way to do that??
Upvotes: 1
Views: 2354
Reputation: 1761
There's no performance penalty for creating another controller, all it does is help you organize your code. Here's how I did it:
**controller**
class UsersController < ApplicationController
def show
@user = User.find(params[:id])
end
end
**routes**
devise_for :users,
resources :users, :only => [:show]
Upvotes: 1