From 5f3a2578c4ecbcd5eddb961251aab0e9e1e1f5cb Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Fri, 4 Mar 2011 15:42:54 -0800 Subject: [PATCH] Combine city and state pulldown menus --- app/controllers/welcome_controller.rb | 6 +++--- app/views/welcome/index.html.erb | 12 +++++------- public/stylesheets/main.css | 1 - 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 1f5f813..3504791 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -4,10 +4,10 @@ class WelcomeController < ApplicationController # Default coordinates: Boston center @lat, @lng = 42.358431, -71.059773 @hydrants = [] - address, city, state = params[:address], params[:city], params[:state] - if address && city && state + address, city_state = params[:address], params[:city_state] + if address && city_state @zoom = 18 - @lat, @lng = Address.find_lat_lng("#{address}, #{city}, #{state}") + @lat, @lng = Address.find_lat_lng("#{address}, #{city_state}") @hydrants = Hydrant.find_closest(@lat, @lng) end end diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 02510ef..bcfce54 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -3,14 +3,12 @@

Claim responsibility for shoveling out a fire hydrant after it snows.

- <%= form_tag do %> - <%= label_tag "state" %> - <%= select_tag "state", ''.html_safe, :tabindex => 10 %> - <%= label_tag "city" %> - <%= select_tag "city", ''.html_safe, :tabindex => 11 %> + <%= form_tag "/", :method => :get, :class => "location_form" do %> + <%= label_tag "city_state", "City" %> + <%= select_tag "city_state", ''.html_safe, :tabindex => 10 %> <%= label_tag "address" %> - <%= text_field_tag "address", params[:address], :tabindex => 12 %> - <%= submit_tag "Find Fire Hydrants", :tabindex => 13 %> + <%= text_field_tag "address", params[:address], :tabindex => 11 %> + <%= submit_tag "Find Fire Hydrants", :tabindex => 12 %> <% end %>
<%= image_tag "logos/boston.png", :alt => "City of Boston", :title => "City of Boston" %> diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index f31e52f..f672898 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -59,7 +59,6 @@ label, input { input, select, option, button, input[type="submit"] { display: block; margin-bottom: 10px; - font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; font-size: 1.0em; width: 100%; }