Class: Api::V1::PlantCountingsController

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

Overview

PlantCountings 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!

Methods included from CallLoggable

#log_request, #log_response

Instance Method Details

#createObject


5
6
7
8
9
10
11
12
# File 'app/controllers/api/v1/plant_countings_controller.rb', line 5

def create
  plant_counting = PlantCounting.new(permitted_params.merge(creator_id: current_user.id))
  if plant_counting.save
    render json: { id: plant_counting.id }, status: :created
  else
    render json: plant_counting.errors, status: :unprocessable_entity
  end
end