This forum is no longer active. Please post your questions to our new community site

routing error

Subscribe to routing error 5 post(s), 2 voice(s)

 
Avatar isea 9 post(s)

Hello All,

I am getting a routing error for every new project I start. I have searched tons for this issue but have come up with nothing that will remedy my problem. I am using RubyStack on a vista machine. Below in my routes.rb let me know what else I can give you for help. Thanks

[code] ActionController::Routing::Routes.draw do |map| # The priority is based upon order of creation: first created -> highest priority.

  1. Sample of regular route:
  2. map.connect ‘products/:id’, :controller => ‘catalog’, :action => ‘view’
  3. Keep in mind you can assign values other than :controller and :action
  1. Sample of named route:
  2. map.purchase ‘products/:id/purchase’, :controller => ‘catalog’, :action => ‘purchase’
  3. This route can be invoked with purchase_url(:id => product.id)
  1. You can have the root of your site routed by hooking up ’’
  2. —just remember to delete public/index.html.
  3. map.connect ’’, :controller => “welcome”
  1. Allow downloading Web Service WSDL as a file with an extension
  2. instead of a file named ‘wsdl’ map.connect ’:controller/service.wsdl’, :action => ‘wsdl’
  1. Install the default route as the lowest priority. map.connect ’:controller/:action/:id.:format’ map.connect ’:controller/:action/:id’
    end
    [/code]
 
Avatar Manuel 71 post(s)

Hi,

Can you please post the error you get and post or send by email your config/routes.rb. It should be similar to this:

ActionController::Routing.draw do |map|
 map.connect '', :controller => 'blog', :action => 'recent'
 map.connect ':controller/:action/:id'
 map.connect 'posts/:category', :controller => 'blog', :action => 'posts'
end

thanks

 
Avatar isea 9 post(s)

Hello, sorry about that. Here is the error:

no route found to match ”/iam” with {:method=>:get}

I’ll try pasting the code in again hopefully it will work out better. Thanks for you help.

I left all the comments just for good measure

ActionController::Routing::Routes.draw do |map|
  # The priority is based upon order of creation: first created -> highest priority.
  # Sample of regular route:
  # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  # Keep in mind you can assign values other than :controller and :action
  # Sample of named route:
  # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  # This route can be invoked with purchase_url(:id => product.id)
  # You can have the root of your site routed by hooking up '' 
  # -- just remember to delete public/index.html.
  # map.connect '', :controller => "welcome" 
  # Allow downloading Web Service WSDL as a file with an extension
  # instead of a file named 'wsdl'
  map.connect ':controller/service.wsdl', :action => 'wsdl'
  # Install the default route as the lowest priority.
  map.connect ':controller/:action/:id.:format'
  map.connect ':controller/:action/:id'
end
 
Avatar Manuel 71 post(s)

Your config/routes.rb seems to be right. What is the URL you enter in the browser to get that error? Do you have a controller called “iam”?

You can generate a controller called “iam” with:

script/generate controller iam

ciao

 
Avatar isea 9 post(s)

I am totally embarrassed to admit that was the problem. I really debated abandoning this post because I was so ashamed :) anyway, thanks a lot!