Class: Api::V1::DesignToolFixturesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/api/v1/design_tool_fixtures_controller.rb

Overview

Controller: design tool fixtures.

Instance Method Summary collapse

Methods inherited from BaseController

#catalog_for_request, #error!, #locale_for_request, #logger, #render_bad_request_response, #render_internal_server_error, #render_not_found_response, #render_result, #render_unprocessable_entity_response, #set_locale, #store_for_request, #underscore_params

Instance Method Details

#findvoid

This method returns an undefined value.

GET /api/v1/design_tool_fixtures/find — the single fixture matching the
name param's class_key.



13
14
15
# File 'app/controllers/api/v1/design_tool_fixtures_controller.rb', line 13

def find
  render json: DesignToolFixture.where(class_key: params[:name])&.first
end

#find_allvoid

This method returns an undefined value.

GET /api/v1/design_tool_fixtures/find_all — fixtures matching the
comma-separated names param's class_keys.



28
29
30
# File 'app/controllers/api/v1/design_tool_fixtures_controller.rb', line 28

def find_all
  render json: DesignToolFixture.where(class_key: params[:names].split(','))
end

#showObject

GET /api/v1/design_tool_fixtures/1.json



5
6
7
# File 'app/controllers/api/v1/design_tool_fixtures_controller.rb', line 5

def show
  render json: DesignToolFixture.find(params[:id])
end

#show_allvoid

This method returns an undefined value.

GET /api/v1/design_tool_fixtures/show_all — every fixture.



20
21
22
# File 'app/controllers/api/v1/design_tool_fixtures_controller.rb', line 20

def show_all
  render json: DesignToolFixture.all
end