Class: JSONAPI::Home::V1::ResourcesController

Inherits:
ApplicationController
  • Object
show all
Includes:
JSONAPI::Home
Defined in:
app/controllers/jsonapi/home/v1/resources_controller.rb

Constant Summary

Constants included from JSONAPI::Home

DEFAULT_DESCRIPTION, JSONAPI::Home::VERSION

Instance Method Summary collapse

Instance Method Details

#indexObject



14
15
16
17
18
19
20
21
22
# File 'app/controllers/jsonapi/home/v1/resources_controller.rb', line 14

def index
  realization = JSONAPI::Realizer.index(
    params,
    headers: request.headers,
    type: :jsonapi_home_resources
  )

  render json: serialize(realization)
end

#showObject



24
25
26
27
28
29
30
31
32
# File 'app/controllers/jsonapi/home/v1/resources_controller.rb', line 24

def show
  realization = JSONAPI::Realizer.show(
    params,
    headers: request.headers,
    type: :jsonapi_home_resources
  )

  render json: serialize(realization)
end