I have created new rails-project. I start Mongrel. I add to project: app/controllers/my_first_controller.rb --------------------------------------------------------- class MyFirstController < ApplicationController def index render :text => ''<html><body>My First Controller</body></html>'' end end http://192.168.1.1:8080/my_first/ -> all OK! Then, I add: app/controllers/my_second_controller.rb --------------------------------------------------------- class MySecondController < ApplicationController def index render :text => ''<html><body>My Second Controller</body></html>'' end end I open: http://192.168.1.1:8080/my_second/ And I have error: No route matches "/my_second/" with {:method=>:get} Why? P.S.: Tested under Mongrel, Thin, Passenger, fastcgi --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Do you restart your project when you added the "my_second_controller" ? The Route will be initialized at start. 2008-09-02 zheng.cuizh 发件人: veejar 发送时间: 2008-09-02 20:41:24 收件人: Ruby on Rails: Talk 抄送: 主题: [Rails] Writing new controllers I have created new rails-project. I start Mongrel. I add to project: app/controllers/my_first_controller.rb --------------------------------------------------------- class MyFirstController < ApplicationController def index render :text = > ' <html > <body >My First Controller </body > </html >' end end http://192.168.1.1:8080/my_first/ - > all OK! Then, I add: app/controllers/my_second_controller.rb --------------------------------------------------------- class MySecondController < ApplicationController def index render :text = > ' <html > <body >My Second Controller </body > </html >' end end I open: http://192.168.1.1:8080/my_second/ And I have error: No route matches "/my_second/" with {:method= >:get} Why? P.S.: Tested under Mongrel, Thin, Passenger, fastcgi --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I work in development-mode. My routes.rb: ------------------------------------------------ ActionController::Routing::Routes.draw do |map| map.connect '':controller/:action/:id'' map.connect '':controller/:action/:id.:format'' end --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Tue, Sep 2, 2008 at 2:50 PM, veejar <veejar.net-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I work in development-mode. > My routes.rb: > ------------------------------------------------ > ActionController::Routing::Routes.draw do |map| > map.connect '':controller/:action/:id'' > map.connect '':controller/:action/:id.:format'' > end > --~--~---------~--~----~------------~-------~--~----~ >I guess you need to restart your server ;-) -- Staf Wagemakers - http://www.wagemakers.be --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
But why? It''s inconveniently! On 2 сент, 15:56, "Staf Wagemakers" <staf.wagemak...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Tue, Sep 2, 2008 at 2:50 PM, veejar <veejar....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I work in development-mode. > > My routes.rb: > > ------------------------------------------------ > > ActionController::Routing::Routes.draw do |map| > > map.connect '':controller/:action/:id'' > > map.connect '':controller/:action/:id.:format'' > > end > > --~--~---------~--~----~------------~-------~--~----~ > > I guess you need to restart your server ;-) > > -- > Staf Wagemakers -http://www.wagemakers.be--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
routes.rb is cached for performance reasons, this might be the problem.... -- Staf Wagemakers - http://www.wagemakers.be 2008/9/2 veejar <veejar.net@gmail.com>> > But why? It's inconveniently! > > On 2 сент, 15:56, "Staf Wagemakers" <staf.wagemak...@gmail.com> wrote: > > On Tue, Sep 2, 2008 at 2:50 PM, veejar <veejar....@gmail.com> wrote: > > > > > I work in development-mode. > > > My routes.rb: > > > ------------------------------------------------ > > > ActionController::Routing::Routes.draw do |map| > > > map.connect ':controller/:action/:id' > > > map.connect ':controller/:action/:id.:format' > > > end > > > --~--~---------~--~----~------------~-------~--~----~ > > > > I guess you need to restart your server ;-) > > > > -- > > Staf Wagemakers -http://www.wagemakers.be > --~--~---------~--~----~------------~-------~--~----~ > > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
But I write not new route. I write new controller. On 2 сент, 16:19, "Staf Wagemakers" <staf.wagemak...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> routes.rb is cached for performance reasons, this might be the problem.... > > -- > Staf Wagemakers -http://www.wagemakers.be > > 2008/9/2 veejar <veejar....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > But why? It''s inconveniently! > > > On 2 сент, 15:56, "Staf Wagemakers" <staf.wagemak...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On Tue, Sep 2, 2008 at 2:50 PM, veejar <veejar....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I work in development-mode. > > > > My routes.rb: > > > > ------------------------------------------------ > > > > ActionController::Routing::Routes.draw do |map| > > > > map.connect '':controller/:action/:id'' > > > > map.connect '':controller/:action/:id.:format'' > > > > end > > > > --~--~---------~--~----~------------~-------~--~----~ > > > > I guess you need to restart your server ;-) > > > > -- > > > Staf Wagemakers -http://www.wagemakers.be > > --~--~---------~--~----~------------~-------~--~----~--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---