我剛開始學習RoR。這是我/app/trip_controller.rb文件路由錯誤沒有路由匹配
class TripController < ApplicationController
layout 'main'
def index
end
def map
session[:location] = Location.new(params[:location])
@map = GMap.new("map_div")
@map.control_init(:large_map => true, :map_type => true)
@map.icon_global_init(GIcon.new(:image => "http://www.google.com/
mapfiles/ms/icons/blue-pushpin.png",
:shadow => "http://www.google.com/mapfiles/shadow50.png",
:icon_size => GSize.new(32,32),
:shadow_size => GSize.new(37,32),
:icon_anchor => GPoint.new(9,32),
:info_window_anchor => GPoint.new(9,2),
:info_shadow_anchor => GPoint.new(18,25)),
"icon_source")
icon_source = Variable.new("icon_source")
source = GMarker.new([session[:location].lat,
session[:location].long],
:title => 'Source',
:info_window => "Start here!",
:icon => icon_source)
@map.overlay_init(source)
@map.center_zoom_init([session[:location].lat,
session[:location].long], 12)
@location = session[:location].location
end
末
,這是我的routes.rb文件
Project::Application.routes.draw do
end
我/應用/視圖文件夾中有下列文件
_search.rhtml
index.rhtml
/layouts
application.html.erb main.rhtml
/trip
_info.rhtml _tabs.rhtml map.rhtml
當我啓動服務器併到達localhost:3000 /我的瀏覽器,我得到錯誤
No route matches [GET] "/trip"
我需要在routes.rb文件中配置任何東西嗎?