i have made a top navigation............. <div id="nav"> <%= link_to "Home", :controller => ''welcome'' %> <%= link_to "FAQ", :controller => ''faq'' %> <%= link_to "Contact", :controller => ''contact'' %> <%= link_to "Terms", :controller => ''terms'' %> <%= link_to "Login", :controller => ''account'', :action => ''login'' %> </div> when i clik on terms or anyother link i get this error----------> No route matches "/terms" with {:method=>:get} and in the controller of terms class TermsController < ApplicationController layout "master" caches_action :index def index @page_title = "Terms" end end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Manish, Post your routes.rb file so we can see how the routes are mapped. -Danimal On Apr 23, 12:50 pm, Manish Nautiyal <rails-mailing-l...@andreas- s.net> wrote:> i have made a top navigation............. > > <div id="nav"> > <%= link_to "Home", :controller => ''welcome'' %> > > <%= link_to "FAQ", :controller => ''faq'' %> > > <%= link_to "Contact", :controller => ''contact'' %> > > <%= link_to "Terms", :controller => ''terms'' %> > > <%= link_to "Login", :controller => ''account'', :action => ''login'' %> > </div> > > when i clik on terms or anyother link i get this error----------> > > No route matches "/terms" with {:method=>:get} > > and in the controller of terms > class TermsController < ApplicationController > layout "master" > caches_action :index > def index > @page_title = "Terms" > end > > end > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Have you tried turning it off and on again? -- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Danimal wrote:> Manish, > > Post your routes.rb file so we can see how the routes are mapped. > > -Danimal > > On Apr 23, 12:50 pm, Manish Nautiyal <rails-mailing-l...@andreas-here is routes.rb-------> 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) # Sample resource route (maps HTTP verbs to controller actions automatically): # map.resources :products # Sample resource route with options: # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get } # Sample resource route with sub-resources: # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller # Sample resource route within a namespace: # map.namespace :admin do |admin| # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb) # admin.resources :products # end # You can have the root of your site routed with map.root -- just remember to delete public/index.html. map.root :controller => "welcome" # See how all your routes lay out with "rake routes" # Install the default routes as the lowest priority. map.connect '':controller/:action/:id'' map.connect '':controller/:action/:id.:format'' end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Interesting. The default routes should be catching those links. I tried quickly putting these into a test application of mine and they worked just fine. The "no route matches..." error only appeared when my controllers were wrong, either missing or misspelled. For example, if I created "app/controllers/terms_controller.rb" which has in it exactly what you put in, then http://localhost:3000/terms works just fine (well, in my example, I get Template Missing errors, but that''s simply because I didn''t create the view code). So, your logic isn''t off... I suspect a typo or spelling error. -Danimal --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Try adding one route # Install the default routes as the lowest priority. map.connect '':controller/:action/:id'' map.connect '':controller/:action/:id.:format'' map.connect '':controller/:action'' end Your default get routes are looking for an ID which you are not providing. Lemme know if it works On Apr 24, 6:34 am, Danimal <fightonfightw...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Interesting. > > The default routes should be catching those links. > > I tried quickly putting these into a test application of mine and they > worked just fine. The "no route matches..." error only appeared when > my controllers were wrong, either missing or misspelled. For example, > if I created "app/controllers/terms_controller.rb" which has in it > exactly what you put in, thenhttp://localhost:3000/termsworks just > fine (well, in my example, I get Template Missing errors, but that''s > simply because I didn''t create the view code). > > So, your logic isn''t off... I suspect a typo or spelling error. > > -Danimal--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ruby Freak wrote:> Try adding one route > # Install the default routes as the lowest priority. > map.connect '':controller/:action/:id'' > map.connect '':controller/:action/:id.:format'' > > map.connect '':controller/:action'' > > end > > Your default get routes are looking for an ID which you are not > providing. > > Lemme know if it worksthx buddy.............all u r efforts.........its works............. :) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ruby Freak wrote:> Try adding one route > # Install the default routes as the lowest priority. > map.connect '':controller/:action/:id'' > map.connect '':controller/:action/:id.:format'' > > map.connect '':controller/:action'' > > end > > Your default get routes are looking for an ID which you are not > providing. > > Lemme know if it worksthx buddy.............all u r efforts.........its works............. :) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---