Class: Cdx::Admin::PublishableResourceController
Instance Method Summary
collapse
belongs_to, #destroy, #edit, #index, #new
#authenticate_admin_user!
#current_settings
Instance Method Details
#create ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/cdx/admin/publishable_resource_controller.rb', line 16
def create
@object.assign_attributes permitted_resource_params
if @object.send current_action
flash_message(@object, :create, :success)
redirect_to location_after_save
else
flash_message(@object, :create, :error)
render :new
end
end
|
#update ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
|
# File 'app/controllers/cdx/admin/publishable_resource_controller.rb', line 4
def update
@object.assign_attributes permitted_resource_params
if @object.send current_action
flash_message(@object, (current_action == :save ? :update : current_action), :success)
redirect_to location_after_save
else
flash_message(@object, (current_action == :save ? :update : current_action), :error)
render :edit
end
end
|