class RacesController

Public Instance Methods

index() click to toggle source

Show Races for a Category

Params

Assigns

  • races

  • category

# File app/controllers/races_controller.rb, line 9
def index
  if params[:event_id]
    @event = Event.includes(:races).find(params[:event_id])
    unless mobile_request?
      redirect_to event_results_path(@event)
    end
  else
    @category = Category.find(params[:category_id])
  end
end
show() click to toggle source
# File app/controllers/races_controller.rb, line 20
def show
  @race = Race.find(params[:id])
  unless mobile_request?
    redirect_to event_results_path(@race.event)
  end
end