Class: Iro::DatapointsController
- Inherits:
-
ApplicationController
- Object
- Wco::ApplicationController
- ApplicationController
- Iro::DatapointsController
- Defined in:
- app/controllers/iro/datapoints_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
params: d, k, v.
- #index ⇒ Object
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
params: d, k, v
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/iro/datapoints_controller.rb', line 5 def create :create, Iro::Datapoint begin Iro::Datapoint.create!( date: params[:d], kind: params[:k], value: params[:v], ) render json: { status: :ok } rescue Mongoid::Errors::Validations => e render json: { status: 401 }, status: 401 end end |