Class: Cathode::ShowRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/cathode/show_request.rb

Overview

Defines the default behavior for a show request.

Instance Attribute Summary

Attributes inherited from Request

#_body, #_status, #action, #context, #custom_logic, #resource

Instance Method Summary collapse

Methods inherited from Request

create, #initialize

Constructor Details

This class inherits a constructor from Cathode::Request

Instance Method Details

#default_action_blockObject

Determine the default action to use depending on the resource. If the resource is singular, set the body to the parent’s associated record. Otherwise, lookup the record directly.



7
8
9
10
11
# File 'lib/cathode/show_request.rb', line 7

def default_action_block
  proc do
    body record
  end
end