Class: Workarea::Admin::CustomEventsController
Instance Method Summary
collapse
#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
#create ⇒ Object
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
|
#destroy ⇒ Object
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
|
#update ⇒ Object
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
|