Add welcome page with Google Map

This commit is contained in:
Erik Michaels-Ober 2011-02-14 13:49:00 -05:00
parent c749f63b1f
commit 6d04f19366
9 changed files with 43 additions and 12 deletions

View File

@ -0,0 +1,2 @@
class WelcomeController < ApplicationController
end

View File

@ -0,0 +1,2 @@
module WelcomeHelper
end

View File

@ -1,14 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<head>
<title>AdoptAHydrant</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= stylesheet_link_tag "main" %>
<%= javascript_include_tag "maps" %>
<%= javascript_include_tag "http://maps.google.com/maps/api/js?sensor=false" %>
<%= csrf_meta_tag %>
</head>
<body>
<%= yield %>
</body>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
</head>
<body onload="initialize()">
<%= yield -%>
</body>
</html>

View File

@ -0,0 +1,3 @@
<div id="map_canvas" style="width:100%; height:100%">
</div>

View File

@ -48,7 +48,7 @@ AdoptAHydrant::Application.routes.draw do
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => "welcome#index"
root :to => "welcome#index"
# See how all your routes lay out with "rake routes"

View File

@ -0,0 +1,9 @@
function initialize() {
var latlng = new google.maps.LatLng(42.358431,-71.059773);
var myOptions = {
zoom: 14,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}

View File

@ -0,0 +1,3 @@
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }

View File

@ -0,0 +1,8 @@
require 'test_helper'
class WelcomeControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

View File

@ -0,0 +1,4 @@
require 'test_helper'
class WelcomeHelperTest < ActionView::TestCase
end