Class: SimpleShowcaseAdmin::SessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/simple_showcase_admin/sessions_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#not_authenticated

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
# File 'app/controllers/simple_showcase_admin/sessions_controller.rb', line 9

def create
  user = (params[:email], params[:password], params[:remember_me])
  if user
    redirect_back_or_to root_path, :notice => "Logged in as #{ current_user.email }"
  else
    redirect_to , :notice => 'Email or password was invalid'
  end
end

#destroyObject



18
19
20
21
22
23
# File 'app/controllers/simple_showcase_admin/sessions_controller.rb', line 18

def destroy
  logout
  if !current_user
    redirect_to , :notice => 'Logged out!'
  end
end

#newObject



5
6
7
# File 'app/controllers/simple_showcase_admin/sessions_controller.rb', line 5

def new
  logout
end