Class: SportDbAdmin::CountriesController

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

Instance Method Summary collapse

Instance Method Details

#indexObject

GET /countries



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

def index
  @countries = Country.all
end

#shortcutObject

GET /:key e.g /at or /us etc.



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

def shortcut
  @country = Country.find_by_key!( params[:key] )
  render :show
end

#showObject

GET /countries/1



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

def show
  @country = Country.find( params[:id] )
end