Class EventsController
In: app/controllers/events_controller.rb
Parent: ApplicationController

Methods

index   show  

Included Modules

Api::Events

Public Instance methods

HTML: Event dashboard for promoter (Person) XML, JSON: Remote API

Params

  • person_id

Returns

JSON and XML results are paginated with a page size of 10

  • event: [ :id, :parent_id, :name, :type, :discipline, :city, :cancelled, :beginner_friendly ]
  • race: [ :id, :distance, :city, :state, :laps, :field_size, :time, :finishers, :notes ]
  • category: [ :id, :name, :ages_begin, :ages_end, :friendly_param ]

See source code of Api::Events and Api::Base

[Source]

    # 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

[Source]

    # File app/controllers/events_controller.rb, line 33
33:   def show
34:     respond_to do |format|
35:       format.xml { render :xml => event_as_xml }
36:       format.json { render :json => event_as_json }
37:     end
38:   end

[Validate]