Sha256: 125730ce84c1ed40e4905712d755a25fb6b824f6a25022910b26274968c7a45d

Contents?: true

Size: 886 Bytes

Versions: 2

Compression:

Stored size: 886 Bytes

Contents

module Caboodle
  class Googlelocal < Caboodle::Kit
    
    description "A google map linking to a list of locations and enabling Local Search around each of them."
    
    required [:google_maps_api_key]
    
    config_files ["googlelocal.yml"]
    
    stylesheets ["http://www.google.com/uds/solutions/mapsearch/gsmapsearch.css", "http://www.google.com/uds/css/gsearch.css"]
    
    before do
      @locations = Config.google_local_locations
      @location = Config.google_local_locations.first
    end
    
    menu "Near me"
    
    get "/near_me/:slug" do
      Config.google_local_locations.each do |loc|
        if loc.title.downcase.gsub(" ","-") == params[:slug]
          @location = loc
        end
      end
            
      if @location
        haml :googlelocal
      else
        redirect "/near_me" 
      end
    end
    
    add_sass ["googlelocal"]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
caboodle-0.2.16 lib/caboodle/kits/googlelocal/googlelocal.rb
caboodle-0.2.15 lib/caboodle/kits/googlelocal/googlelocal.rb