Class: UsersController

Inherits:
ApplicationController show all
Includes:
IcalHelper
Defined in:
app/controllers/users_controller.rb

Instance Method Summary collapse

Methods included from IcalHelper

#calendar_link, #icalendar

Instance Method Details

#calendarObject


14
15
16
17
18
19
20
# File 'app/controllers/users_controller.rb', line 14

def calendar
  respond_to do |format|
    format.ics do
      render text: icalendar(*user.participations)
    end
  end
end

#destroyObject


30
31
32
33
34
35
36
37
# File 'app/controllers/users_controller.rb', line 30

def destroy
  if current_user.events.present?
    redirect_to edit_user_path(current_user), alert: t("user.not_removed_organizer")
  else
    current_user.destroy
    redirect_to destroy_session_path, notice: t("user.removed")
  end
end

#editObject


12
# File 'app/controllers/users_controller.rb', line 12

def edit; end

#indexObject


10
# File 'app/controllers/users_controller.rb', line 10

def index; end

#showObject


11
# File 'app/controllers/users_controller.rb', line 11

def show; end

#updateObject


22
23
24
25
26
27
28
# File 'app/controllers/users_controller.rb', line 22

def update
  if current_user.update_attributes user_params
    redirect_to :back, notice: t("user.saved_successful")
  else
    redirect_to :back, alert: current_user.errors.full_messages.join(' ')
  end
end