Class: EventsController

Inherits:
ApplicationController show all
Includes:
IcalHelper
Defined in:
app/controllers/events_controller.rb

Instance Method Summary collapse

Methods included from IcalHelper

#calendar_link, #icalendar

Instance Method Details

#indexObject


10
11
12
13
14
15
16
17
# File 'app/controllers/events_controller.rb', line 10

def index
  respond_to do |format|
    format.html
    format.xml  { render layout: false }
    format.json { render json: events.as_api_response(:ios_v1) }
    format.ics  { render text: icalendar(*events) }
  end
end

#showObject


19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/events_controller.rb', line 19

def show
  respond_to do |format|
    format.html
    format.json do
      render json: event.as_api_response(:ios_v1)
    end
    format.ics do
      render text: icalendar(event)
    end
  end
end