A question about the RESTful Routing.


Thank you for reading my post, if I am not being careful about the use
of terminology or am not being exactly clear enough for my question to
be understood, kindly notify and I will correct.

I remember that when I used Rails 1.2, I can just add a blank action
in a controller and then create a .rhtml with that same name as does
the action and then I can just write "hello world"in that .rhtml and
it will show in http://localhost:3000/controller/thatNewActionIJustWrote/

Now, I go back to my bookstore controller and add
def greenapple

and I go create greenapple.html.erb
and I typed "hello world" in greenapple.html.erb (I know it's silly, I
just wanted to demonstrate what my problem is)

It gives me:
Routing Error
No route matches "/greenapple/" with {:method => :get}

Any ideas? Or, which I am sure, if you know some web pages that I can
read through, that will be great, too!!

Thanks a quintillion!


Hello all!

I am not sure if I have solved this, maybe I shouldn't trying things
out at 1am.

But here's what I got
I added one line
'greenapple', :controller=>'bookstore', :action=>'greenapple'
in the config/routes.rb

And it worked!

Can I change my question to:
If I am to add a new action in a controller, do I always have to
manually specify a map.connect 'name of that new action', :controller
=> 'name of that controller', :action=>'name of that action again'

If so, how come this is the case whereas the old rails needs not? If
not, what's the advantage?

Thank You all! Have a great day!