Re: Writing new controllers

zheng.cuizh
Tue, 02 Sep 2008 12:48:52 -0000

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 = > ' My First Controller
'
  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 = > ' My Second Controller
'
  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