Class: SportDbAdmin::EventsController

Inherits:
SportDbAdminController show all
Defined in:
app/controllers/sport_db_admin/events_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject

GET /events



8
9
10
# File 'app/controllers/sport_db_admin/events_controller.rb', line 8

def index
  @events = Event.all
end

#shortcutObject

GET /:key e.g /euro.2012 or /at.2011_12 etc.



18
19
20
21
# File 'app/controllers/sport_db_admin/events_controller.rb', line 18

def shortcut
  @event = Event.find_by_key!( params[:key].tr('_','/') )
  render :show
end

#showObject

GET /events/1



13
14
15
# File 'app/controllers/sport_db_admin/events_controller.rb', line 13

def show
  @event = Event.find( params[:id] )
end