Class: Cdx::Admin::PublishableResourceController
- Inherits:
-
ResourceController
- Object
- ActionController::Base
- Cdx::ApplicationController
- BaseController
- ResourceController
- Cdx::Admin::PublishableResourceController
- Defined in:
- app/controllers/cdx/admin/publishable_resource_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from ResourceController
belongs_to, #destroy, #edit, #index, #new
Methods inherited from BaseController
#authenticate_admin_user!, #current_ability, #meta_title
Methods inherited from Cdx::ApplicationController
Methods included from ControllerHelpers::Settings
Methods included from ControllerHelpers::Seo
#canonical_url, #contextual_record, #meta_data, #meta_title, #open_graph_data
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 (@object, :create, :success) redirect_to location_after_save else (@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 (@object, (current_action == :save ? :update : current_action), :success) redirect_to location_after_save else (@object, (current_action == :save ? :update : current_action), :error) render :edit end end |