2

I installed Devise today and everything works fine so far. The only thing devise seems not to offer is a 'registration#show' action, which displays the user information (instead of the registration edit page). I tried to override the registrations-controller, but get the error: 'Unknown action-AbstractController::ActionNotFound' for all actions on this controller. Does anybody know how to display the profile information? Thanks!

class RegistrationsController < Devise::RegistrationsController
  def new
    super
  end

  def create
    super
  end

  def show
  end

  def update
    super
  end
end 
Patrick
  • 7,903
  • 11
  • 52
  • 87

2 Answers2

4

I would try to make a new controller based on my authentication model, let's say my authentication model is User. Just create a new controller and make a show page. Something like this should work.

class UsersController < ApplicationController
  def show
    @user = User.find(params[:id])
    # If this show page is only for the currently logged in user change it to @user = current_user
  end
end

Now simply add a view where you list the attributes you want to see and you should be done :)

Maran
  • 2,751
  • 15
  • 12
0

Infact devise by-itself offers a great way to customize it.

try running :-

 "rails generate devise_views" or in newer version of devise try the below    
 "rails generate devise:views" .

This will generate all the views, which you can edit , customise and set route to.
Try this link http://asciicasts.com/episodes/210-customizing-devise for more info.

Hemanth
  • 5,035
  • 9
  • 41
  • 59
  • 2
    Sure, but there's no view for registration#show, just registration#edit and #new. And even if you add the view, the devise-Controller doesn't support it. – Patrick Oct 29 '10 at 07:29
  • This is not a good answer because there is no registration#show when you run this command – Kees Sonnema Jul 04 '12 at 12:18