Class: Mobile::ShowsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/mobile/shows_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/controllers/mobile/shows_controller.rb', line 27

def index
  organization = current_user.organizations.find(params[:organization_id])
  event = organization.events.find(params[:event_id])
  shows = event.shows

  if params[:now]
    around = Time.parse(params[:now])
    shows = shows.where("datetime > ?", around - 12.hours)
  end

  render :json => shows, :event => false
end

#showObject



21
22
23
24
25
# File 'app/controllers/mobile/shows_controller.rb', line 21

def show
  organization = current_user.organizations.find(params[:organization_id])
  show = organization.shows.find(params[:id])
  render :json => show, :serializer => ShowSerializer
end