| Class | EventsController |
| In: |
app/controllers/events_controller.rb
|
| Parent: | ApplicationController |
HTML: Event dashboard for promoter (Person) XML, JSON: Remote API
JSON and XML results are paginated with a page size of 10
See source code of Api::Events and Api::Base
# File app/controllers/events_controller.rb, line 16
16: def index
17: respond_to do |format|
18: format.html {
19: if params[:person_id]
20: @person = Person.find(params[:person_id])
21: @events = @person.events.find(
22: :all,
23: :conditions => [ "date between ? and ?", RacingAssociation.current.effective_today.beginning_of_year, RacingAssociation.current.effective_today.end_of_year ])
24: else
25: redirect_to schedule_path
26: end
27: }
28: format.xml { render :xml => events_as_xml }
29: format.json { render :json => events_as_json }
30: end
31: end