Class: Subscribem::Account::SessionsController

Inherits:
Subscribem::ApplicationController show all
Defined in:
app/controllers/subscribem/account/sessions_controller.rb

Instance Method Summary collapse

Methods inherited from Subscribem::ApplicationController

#authenticate_user!, #current_account, #current_user, #force_authentication!, #user_signed_in?

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/subscribem/account/sessions_controller.rb', line 7

def create
  if env["warden"].authenticate(:scope => :user)
    flash[:notice] = "You are now signed in."
    redirect_to root_path
  else
    @user = User.new
    flash[:error] = "Invalid email or password."
    render :action => "new"
  end
end

#newObject



3
4
5
# File 'app/controllers/subscribem/account/sessions_controller.rb', line 3

def new
  @user = User.new
end