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

#findObject



9
10
11
# File 'app/controllers/api/v1/design_tool_fixtures_controller.rb', line 9

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

#find_allObject



17
18
19
# File 'app/controllers/api/v1/design_tool_fixtures_controller.rb', line 17

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_allObject



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

def show_all
  render json: DesignToolFixture.all
end