Forum: Ruby on Rails confusing singleton resource

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ffd881829651935d986c52d12279befb?d=identicon&s=25 Zhenning Guan (rubyernewbie)
on 2009-02-07 15:52
I have a controller name homes, I would add the line
map.resource :home
so I like to return a url like
/home/1, /home/2......etc
but why I open up my browser
http://127.0.0.1:3000/home/1
it appear the message like this:
No route matches "/home/1" with {:method=>:get}

so, what is wrong with me?
A1b97dafea62b11e7b3bef338ce3fe83?d=identicon&s=25 Billy Hsu (cfc)
on 2009-02-07 16:02
(Received via mailing list)
map.resource is for modelif you have a model named: home
then you must use:
map.resources :home
and generate a controller named: homes

On Sat, Feb 7, 2009 at 10:52 PM, Zhenning Guan <
rails-mailing-list@andreas-s.net> wrote:

> so, what is wrong with me?
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


--
TWRUG Blog:
http://blog.rubyonrails.org.tw

CFC on Rails:
http://zusocfc.blogspot.com

Only two surfaces of a box:
http://blog.pixnet.net/zusocfc
Ffd881829651935d986c52d12279befb?d=identicon&s=25 Zhenning Guan (rubyernewbie)
on 2009-02-08 05:19
I addd these code into entries show view
==
<%= link_to 'ca', home_path(2) %>
<%= link_to "cc", entry_path(2) %>
==

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.to_sym


Extracted source (around line #1):


help...
This topic is locked and can not be replied to.