Class: Api::V1::PlantDensityAbaciController

Inherits:
BaseController show all
Defined in:
app/controllers/api/v1/plant_density_abaci_controller.rb

Overview

PlantDensityAbaci API permits to access plant_density_abaci

Instance Method Summary collapse

Methods inherited from BaseController

#add_generic_headers!, #authenticate_api_user!, #authenticate_user_from_simple_token!, #force_json!

Instance Method Details

#indexObject


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

def index
  render json: PlantDensityAbacus.order(id: :desc).limit(25), status: :ok
end

#showObject


9
10
11
12
13
14
15
# File 'app/controllers/api/v1/plant_density_abaci_controller.rb', line 9

def show
  @plant_density_abacus = PlantDensityAbacus.find_by(id: params[:id])
  unless @plant_density_abacus
    render json: { message: 'Not found' }, status: :not_found
    return false
  end
end