Class: DirectoryController

Inherits:
ApplicationController show all
Defined in:
app/controllers/directory_controller.rb

Instance Method Summary collapse

Instance Method Details

#searchObject



2
3
4
5
6
7
8
# File 'app/controllers/directory_controller.rb', line 2

def search
  if searching_by_zip?
    search_by_zip
  else
    search_by_string
  end
end

#searching_by_zip?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'app/controllers/directory_controller.rb', line 16

def searching_by_zip?
  params[:criteria] =~ /[0-9]{5}/
end

#showObject



10
11
12
13
14
# File 'app/controllers/directory_controller.rb', line 10

def show
  @locale = find_locale || Locale.init_root
  @location = @locale.location
  Rails.logger.info "Found a #{@locale.kind} locale: #{@locale.name}"
end