Class: Workarea::Admin::CustomEventsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/workarea/admin/custom_events_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user, #find_sort, #wrap_in_view_model, wrap_in_view_model

Methods included from Publishing

#allow_publishing!, #allow_publishing?, #set_publishing_options

Methods included from Visiting

#most_visited

Instance Method Details

#createObject



6
7
8
9
10
# File 'app/controllers/workarea/admin/custom_events_controller.rb', line 6

def create
  @custom_event.save!
  flash[:success] = t('workarea.admin.reports.timeline.flash_messages.created')
  redirect_back fallback_location: root_path
end

#destroyObject



24
25
26
27
28
# File 'app/controllers/workarea/admin/custom_events_controller.rb', line 24

def destroy
  @custom_event.destroy
  flash[:success] = t('workarea.admin.reports.timeline.flash_messages.success')
  redirect_back fallback_location: root_path
end

#updateObject



12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/workarea/admin/custom_events_controller.rb', line 12

def update
  if @custom_event.update(params[:custom_event])
    flash[:success] =
      t('workarea.admin.reports.timeline.flash_messages.success')
  else
    flash[:error] =
      t('workarea.admin.reports.timeline.flash_messages.error')
  end

  redirect_back fallback_location: root_path
end