Json listing of events

This commit is contained in:
echarp 2015-11-07 15:11:53 +01:00
parent 19e3b659fd
commit 2e2d790d35
2 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@ class EventsController < ApplicationController
def index
respond_to do |format|
format.html { render layout: 'iframe' if params[:iframe] }
format.json { }
format.rss { @events = @events.future }
format.ics { @events = @events.last_year.includes :region }
format.xml { @events = @events.includes :region }

View File

@ -1,6 +1,6 @@
json.array!(@events) do |event|
json.extract! event, :id, :title, :description, :start_time, :end_time,
:address, :city, :region_id, :locality, :url, :contact,
:place_name, :address, :city, :region_id, :locality, :url,
:contact, :submitter, :moderated, :tags, :secret,
:decision_time, :submission_time, :moderator_mail_id,
:submitter_mail_id