Class: RegistrationsController

Inherits:
Devise::RegistrationsController
  • Object
show all
Defined in:
app/controllers/registrations_controller.rb

Instance Method Summary collapse

Instance Method Details

#confirmObject

show confirmation for registration of existing users



29
30
# File 'app/controllers/registrations_controller.rb', line 29

def confirm
end

#createObject



14
15
16
17
18
19
20
21
22
# File 'app/controllers/registrations_controller.rb', line 14

def create
  @group = Group.find(params[:user][:requested_group]) if params[:user][:requested_group] 
  super
  unless @user.new_record?
    Registrations.group_user_registration_email(
      @group, @user, edit_groups_user_url(@user.groups_users.last)
    ).deliver
  end
end

#indexObject



6
7
# File 'app/controllers/registrations_controller.rb', line 6

def index
end

#loginObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'app/controllers/registrations_controller.rb', line 32

def 
  # redirected to here after AJAX login
  if user_signed_in?
    render :json => {
      :success => true,
      :user => {
        :login => current_user.,
        :email => current_user.email,
        :name => current_user.name,
        :app_infos => current_user.app_infos
      },
      :roles => current_roles.roles.collect(&:name)
    }
  else
    render :json => {
      :success => false, :user => {}, :roles => []
    }
  end
end

#logoutObject



52
53
54
# File 'app/controllers/registrations_controller.rb', line 52

def logout
  render :nothing => true
end

#newObject



9
10
11
12
# File 'app/controllers/registrations_controller.rb', line 9

def new
  @group = Group.find_by_name(params[:group])
  super
end

#updateObject



24
25
26
# File 'app/controllers/registrations_controller.rb', line 24

def update
  super
end