Class: Api::V1::WeatherReadingsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/orb_def/api/v1/weather_readings_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



4
5
6
7
# File 'app/controllers/orb_def/api/v1/weather_readings_controller.rb', line 4

def show
  reading = WeatherStation.find(params['id'].to_i).weather_readings.last
  render json: reading.to_json, status: :ok
end