agenda-libre-ruby/app/controllers/maps_controller.rb

27 lines
669 B
Ruby
Raw Normal View History

# Geocoding
#
# Access to OSM controls
class MapsController < ApplicationController
2015-11-10 23:29:05 +01:00
has_scope :region, :locality, :tag, :daylimit
has_scope :future, type: :boolean, default: true
has_scope :period, type: :hash, using: %i[year week]
has_scope :near, type: :hash, using: %i[location distance]
def index
respond_to do |format|
format.html
format.json { render json: apply_scopes(Event.moderated.geo) }
end
end
def show
2016-10-15 16:39:15 +02:00
@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