views:

49

answers:

2

I'm getting a Routing error when trying to access my page.

Routing Error  
No route matches "/" with {:method=>:get}

The error log reads:

[4;36;1mSQL (0.1ms)[0m   [0;1mSET NAMES 'utf8'[0m
[4;35;1mSQL (0.0ms)[0m   [0mSET SQL_AUTO_IS_NULL=0[0m


Processing ApplicationController#index (for 68.116.193.166 at 2010-10-11 19:18:16) [GET]

ActionController::RoutingError (No route matches "/" with {:method=>:get}):
  config/initializers/mongrel.rb:62:in `dispatch_cgi'

Rendering rescues/layout (not_found)

Usually when I see this I check that the route is defined in config/routes.rb, and they are. So I figured maybe I can access /new by typing it in which gave me the following error.

Routing Error  
No route matches **"//new"** with {:method=>:get}

With the following in development.log

[4;36;1mSQL (0.1ms)[0m   [0;1mSET NAMES 'utf8'[0m
[4;35;1mSQL (0.0ms)[0m   [0mSET SQL_AUTO_IS_NULL=0[0m


 Processing ApplicationController#index (for 68.116.193.166 at 2010-10-11 19:18:21) [GET]

 ActionController::RoutingError (No route matches "//new" with {:method=>:get}):
config/initializers/mongrel.rb:62:in `dispatch_cgi'

 Rendering rescues/layout (not_found)

My setup: Rails: 2.3.8 Ruby: 1.8.7 RubyGems: 1.3.7 Mongrel: 1.1.5

I find it odd that using the address /imgs/new returns the path "//new". I've been stressing over this for a few days and have gotten nowhere with finding answers. Hopefully someone knows how to fix this that can point out what I'm missing here. Thanks in Advance

A: 

Here is my config/routes.rb file

ActionController::Routing::Routes.draw do |map|
map.resources :vids  
map.resources :users  
map.resources :tasks  
map.resources :quotes  
map.resources :projects  
map.resources :products  
map.resources :permissions  
map.resources :pages  
map.resources :orders  
map.resources :imgs  
map.resources :documents  
map.resources :contents  
map.resources :contacts  
map.resources :comments  
map.resources :clients  
map.resources :addresses  
map.resources :users  
map.login "login", :controller => "user_sessions", :action => "new"  
map.logout "logout", :controller => "user_sessions", :action => "destroy"  
map.connect ':controller/:action/:id'  
map.connect ':controller/:action/:id.:format'  
end
DeepThought
So where is the root route? Since you getting no route matches `/` which should be the root route. You should have something like `map.root :controller => "something"`
PeterWong
I can't believe I missed that. I have added that back in but now it reroutes everything to that path. So if I go to www.swinkapps.com/imgs or www.swinkapps.com/users I get the same index page for "projects" as that's what I set the root as. And even then if I try and create a new project it gives me the following error Routing Error No route matches "//new" with {:method=>:get}
DeepThought
I don't think that's his problem. 'map.root :controller' is not necessary. From the default routes.rb: "You can have the root of your site routed with map.root -- just remember to delete public/index.html."
SooDesuNe
A: 

It just dawned on me that I might be able to get to the models by making sure the port is included and sure enough www.swinkapps.com:12005/imgs gives me the proper response. Is there a way to override this so that www.swinkapps.com:12005 maps to www.swinkapps.com?

DeepThought