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? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
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-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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? > -- > 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 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
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... -- 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-/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 -~----------~----~----~----~------~----~------~--~---