Class: DouguiUsers::UserSessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/dougui_users/user_sessions_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#load_user_using_perishable_token

Instance Method Details

#createObject

POST /user_sessions POST /user_sessions.xml



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

def create
  @user_session = UserSession.new(params[:user_session])
  @user_session.remember_me = true
  if @user_session.save
    redirect_to(root_path)
  else
    render :action => "new"
  end
end

#destroyObject

DELETE /user_sessions/1 DELETE /user_sessions/1.xml



26
27
28
29
30
31
32
# File 'app/controllers/dougui_users/user_sessions_controller.rb', line 26

def destroy
  @user_session = UserSession.find
  if @user_session
    @user_session.destroy
  end
  redirect_to root_path
end

#newObject

GET /user_sessions/new GET /user_sessions/new.xml



8
9
10
# File 'app/controllers/dougui_users/user_sessions_controller.rb', line 8

def new
  @user_session = UserSession.new
end