agenda-libre-ruby/app/controllers/maps_controller.rb
echarp fd1c11265b Latest active_admin version should work with adl.
But waiting for ruby > 2.1 in production...
2017-07-28 00:35:14 +02:00

27 lines
676 B
Ruby

# Geocoding
#
# Access to OSM controls
class MapsController < ApplicationController
has_scope :region, :locality, :tag, :daylimit, :year
has_scope :near, type: :hash, using: %i[location distance]
has_scope :future, type: :boolean, default: true
has_scope :period, type: :hash, using: %i[year week]
def index
respond_to do |format|
format.html
format.json { render json: apply_scopes(Event.moderated.geo) }
end
end
def show
@kind = Kind.find_by name: params[:id]
respond_to do |format|
format.html
format.json do
render json: apply_scopes(Orga.moderated.active.geo).where(kind: @kind)
end
end
end
end