Class: PersonalBlog::SessionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  session[:password] = params[:session][:password]
  if admin?
    flash[:notice] = "Successfully Logged In"
    redirect_to posts_path
  else
    flash[:notice] = "Incorrect password, please try again."
    redirect_to 
  end
end

#destroyObject



20
21
22
23
24
# File 'app/controllers/personal_blog/sessions_controller.rb', line 20

def destroy
  reset_session
  flash[:notice] = 'Successfully Logged Out'
  redirect_to 
end

#newObject



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

def new
end