Sha256: 266ccdfaa85fa549d614023a0e276e236fefd2306113196eac611ff91fd87373

Contents?: true

Size: 873 Bytes

Versions: 2

Compression:

Stored size: 873 Bytes

Contents

# encoding: utf-8

module BeerDbAdmin

class CountriesController < BeerDbAdminController
  
  def index
    # list by continent
  end


  # GET /:key  e.g  /at or /us etc.
  def shortcut

    order = params[:order] || 'title'

    if order == 'key'
      @order_clause = 'key'
    elsif order == 'hl'
      @order_clause = 'prod desc, title'
    elsif order == 'adr'
      @order_clause = 'address, title'
    else   # by_title
      @order_clause = 'title'
    end
    
    @country = Country.find_by_key!( params[:key] )
    
    style = params[:style] || 'std'
    
    if style == 'pocket'
      render :show_pocket
    else
      render :show
    end
  end

  # GET /countries/:id  e.g. /countries/1
  def show
    @country = Country.find( params[:id] )
  end


end # class CountriesController

end # module BeerDbAdmin

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
beerdb-admin-0.1.2 app/controllers/beer_db_admin/countries_controller.rb
beerdb-admin-0.1.1 app/controllers/beer_db_admin/countries_controller.rb