Class: RubberRing::SessionsController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/rubber_ring/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
16
17
18
19
# File 'app/controllers/rubber_ring/sessions_controller.rb', line 11

def create
  if params[:password] == RubberRing.admin_password
    session[:password] = params[:password]
    redirect_to main_app.root_path
  else
    flash.now[:error] = 'Wrong password'
    render :new
  end
end

#destroyObject



6
7
8
9
# File 'app/controllers/rubber_ring/sessions_controller.rb', line 6

def destroy
  session[:password] = nil
  redirect_to main_app.root_path
end

#newObject



3
4
# File 'app/controllers/rubber_ring/sessions_controller.rb', line 3

def new
end