Add stub of alerts route
This commit is contained in:
4
app/controllers/api/v1/parks/alerts_controller.rb
Normal file
4
app/controllers/api/v1/parks/alerts_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
module Api::V1::Parks
|
||||
class AlertsController < BaseController
|
||||
end
|
||||
end
|
||||
12
app/controllers/api/v1/parks/base_controller.rb
Normal file
12
app/controllers/api/v1/parks/base_controller.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
module Api::V1::Parks
|
||||
class BaseController < ApplicationController
|
||||
before_action :set_park
|
||||
|
||||
private
|
||||
|
||||
def set_park
|
||||
@park = Park.find_by(code: params[:park_code])
|
||||
head :not_found unless @park.present?
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user