Class: Cuprum::Rails::Responders::Html::SingularResource
- Inherits:
-
Resource
- Object
- BaseResponder
- Cuprum::Rails::Responders::HtmlResponder
- Resource
- Cuprum::Rails::Responders::Html::SingularResource
- Defined in:
- lib/cuprum/rails/responders/html/singular_resource.rb
Overview
Defines default responses for a singular RESTful resource.
-
#create failure: renders the :new template.
-
#create success: redirects to the resource #show page.
-
#destroy success: redirects to the parent resource.
-
#update failure: renders the :edit template.
-
#update success: redirects to the resource #show page.
Responds to any other successful result by rendering the template for the action name and passing the result value as assigned variables. For a failing result, redirects to the parent resource.
Instance Attribute Summary
Attributes included from Matching
Attributes inherited from BaseResponder
#action_name, #controller, #controller_name, #request, #resource, #result
Instance Method Summary collapse
-
#initialize(**options) ⇒ SingularResource
constructor
A new instance of SingularResource.
Methods inherited from Cuprum::Rails::Responders::HtmlResponder
Methods included from Actions
Methods included from Matching
#call, #format, #member_action?
Methods included from Rendering
#head, #redirect_back, #redirect_to, #render
Methods inherited from BaseResponder
#call, #member_action?, #routes
Constructor Details
#initialize(**options) ⇒ SingularResource
Returns a new instance of SingularResource.
21 22 23 24 25 26 27 28 |
# File 'lib/cuprum/rails/responders/html/singular_resource.rb', line 21 def initialize(**) super SleepingKingStudios::Tools::CoreTools.deprecate( 'Cuprum::Rails::Responders::Html::SingularResource', message: 'use Cuprum::Rails::Responders::Html::Resource' ) end |