Combine city and state pulldown menus
This commit is contained in:
parent
013eed231c
commit
5f3a2578c4
|
@ -4,10 +4,10 @@ class WelcomeController < ApplicationController
|
||||||
# Default coordinates: Boston center
|
# Default coordinates: Boston center
|
||||||
@lat, @lng = 42.358431, -71.059773
|
@lat, @lng = 42.358431, -71.059773
|
||||||
@hydrants = []
|
@hydrants = []
|
||||||
address, city, state = params[:address], params[:city], params[:state]
|
address, city_state = params[:address], params[:city_state]
|
||||||
if address && city && state
|
if address && city_state
|
||||||
@zoom = 18
|
@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)
|
@hydrants = Hydrant.find_closest(@lat, @lng)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,14 +3,12 @@
|
||||||
<p id="tagline">
|
<p id="tagline">
|
||||||
Claim responsibility for shoveling out a fire hydrant after it snows.
|
Claim responsibility for shoveling out a fire hydrant after it snows.
|
||||||
</p>
|
</p>
|
||||||
<%= form_tag do %>
|
<%= form_tag "/", :method => :get, :class => "location_form" do %>
|
||||||
<%= label_tag "state" %>
|
<%= label_tag "city_state", "City" %>
|
||||||
<%= select_tag "state", '<option value="MA" selected="selected">Massachusetts</option>'.html_safe, :tabindex => 10 %>
|
<%= select_tag "city_state", '<option value="Boston, MA" selected="selected">Boston, MA</option>'.html_safe, :tabindex => 10 %>
|
||||||
<%= label_tag "city" %>
|
|
||||||
<%= select_tag "city", '<option value="Boston" selected="selected">Boston</option>'.html_safe, :tabindex => 11 %>
|
|
||||||
<%= label_tag "address" %>
|
<%= label_tag "address" %>
|
||||||
<%= text_field_tag "address", params[:address], :tabindex => 12 %>
|
<%= text_field_tag "address", params[:address], :tabindex => 11 %>
|
||||||
<%= submit_tag "Find Fire Hydrants", :tabindex => 13 %>
|
<%= submit_tag "Find Fire Hydrants", :tabindex => 12 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div id="logos">
|
<div id="logos">
|
||||||
<%= image_tag "logos/boston.png", :alt => "City of Boston", :title => "City of Boston" %>
|
<%= image_tag "logos/boston.png", :alt => "City of Boston", :title => "City of Boston" %>
|
||||||
|
|
|
@ -59,7 +59,6 @@ label, input {
|
||||||
input, select, option, button, input[type="submit"] {
|
input, select, option, button, input[type="submit"] {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
|
|
||||||
font-size: 1.0em;
|
font-size: 1.0em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue