More data in the geojson for each event, mostly start and end time

This commit is contained in:
echarp 2015-11-07 13:47:15 +01:00
parent 7605c39df5
commit b8c83de708
1 changed files with 3 additions and 3 deletions

View File

@ -82,10 +82,10 @@ class Event < ActiveRecord::Base
end
def as_json(_options = {})
popup = "<a href=\"/#{self.class.name.downcase.pluralize}/#{id}\""
popup += " >#{start_time.to_date} #{city}: #{title}</a>"
{ type: 'Feature', properties: {
id: id, name: title, tags: tags, popupContent: popup
id: id, name: title, tags: tags,
popupContent: "<a href=\"/events/#{id}\">#{self}</a>",
start_time: start_time, end_time: end_time, locality: locality
}, geometry: {
type: 'Point', coordinates: [longitude, latitude]
} }