Class: BeerDbAdmin::CitiesController

Inherits:
BeerDbAdminController show all
Defined in:
app/controllers/beer_db_admin/cities_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
# File 'app/controllers/beer_db_admin/cities_controller.rb', line 7

def index
  @cities = City.all
end

#shortcutObject



16
17
18
19
20
21
22
# File 'app/controllers/beer_db_admin/cities_controller.rb', line 16

def shortcut
  # todo/fix: check if city key is unique ? or needs country or region??

  @city = City.find_by_key!( params[:key] )

  render :show
end

#showObject



11
12
13
# File 'app/controllers/beer_db_admin/cities_controller.rb', line 11

def show
  @city = City.find( params[:id] )
end