I am referring to a book according to which the "routes.rb" code is as below: ================= [Code] ====================MeBay::Application.routes.draw do |map| map.connect ''ads/:id'', :controller=>''ads'', :action=>''show'' map.connect '':controller/:action/:id'' map.connect '':controller/:action/:id.:format'' end ============================================= When I try to open this route from the browser by typing: http://localhost:3000/ads/3 I am getting error: ================================================RuntimeError You are using the old router DSL which has been removed in Rails 3.1. Please check how to update your routes file at: http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/ or add the rails_legacy_mapper gem to your Gemfile ================================================ What changes are needed? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 23 August 2012 08:01, Rubyist Rohit <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I am referring to a book according to which the "routes.rb" code is as > below: > > ================= [Code] ====================> MeBay::Application.routes.draw do |map| > map.connect ''ads/:id'', :controller=>''ads'', :action=>''show'' > map.connect '':controller/:action/:id'' > map.connect '':controller/:action/:id.:format'' > end > =============================================> > When I try to open this route from the browser by typing: > > http://localhost:3000/ads/3 > > I am getting error: > > ================================================> RuntimeError > > You are using the old router DSL which has been removed in Rails 3.1. > Please check how to update your routes file at: > http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/ or > add the rails_legacy_mapper gem to your Gemfile > ================================================> > What changes are needed?Did you check the link given, it looks pretty good to me? Also see the Rails Guide on Routing, it should sort you out. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Radovan Šmitala
2012-Aug-23 09:52 UTC
Re: Updating Controller template to run with Rails 3.2.8
See link what you get. Section Regular Routes Use: match ''products/:id'', :to => ''catalog#view'' instead> map.connect ''ads/:id'', :controller=>''ads'', :action=>''show'' >On Thursday, August 23, 2012 9:01:32 AM UTC+2, Ruby-Forum.com User wrote:> > I am referring to a book according to which the "routes.rb" code is as > below: > > ================= [Code] ===================== > MeBay::Application.routes.draw do |map| > map.connect ''ads/:id'', :controller=>''ads'', :action=>''show'' > map.connect '':controller/:action/:id'' > map.connect '':controller/:action/:id.:format'' > end > ============================================== > > When I try to open this route from the browser by typing: > > http://localhost:3000/ads/3 > > I am getting error: > > ================================================= > RuntimeError > > You are using the old router DSL which has been removed in Rails 3.1. > Please check how to update your routes file at: > http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/ or > add the rails_legacy_mapper gem to your Gemfile > ================================================= > > What changes are needed? > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/G_yumt1NrHoJ. For more options, visit https://groups.google.com/groups/opt_out.