Class: PersonSessionsController

Inherits:
Forgeos::ApplicationController show all
Defined in:
app/controllers/person_sessions_controller.rb

Instance Method Summary collapse

Methods inherited from Forgeos::ApplicationController

#notifications

Instance Method Details

#createObject



6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/person_sessions_controller.rb', line 6

def create
  @person_session = PersonSession.new(params[:person_session])
  if @person_session.save
    redirect_to_stored_location(:root)
    flash[:notice] = t('log.in.success').capitalize
  else
    flash[:error] = t('log.in.failed').capitalize
    redirect_to_stored_location({:action => new})
  end
end

#destroyObject



17
18
19
20
21
# File 'app/controllers/person_sessions_controller.rb', line 17

def destroy
  current_user_session.destroy
  flash[:notice] = I18n.t('log.out.success').capitalize
  redirect_to(:root)
end

#newObject



2
3
4
# File 'app/controllers/person_sessions_controller.rb', line 2

def new
  @person_session = PersonSession.new
end