On 22 May 2011 07:41, John shelfer <[email protected]> wrote:
>
>
> On May 21, 2:45 pm, Frederick Cheung <[email protected]>
> wrote:
>> On May 21, 4:22 pm, John shelfer <[email protected]> wrote:
>>
>> > On May 21, 5:13 am, Colin Law <[email protected]> wrote:
>>
>> >    yes i added a resource and now router.rb look likes but same issue
>> > is still there
>>
>> > Check::Application.routes.draw do
>> >   get "posts/index"
>> >  resources :post
>>
>> resources should be plural, ie resources :posts
>      Thank you very much.It worked.But now i got another error in
> following file ,it says
>
> "undefined method `name' for #<Post id: nil, created_at: nil,
> updated_at: nil>"

Look at the error and try and work out what it means.  There should
also be an indication of which line generated the error.  It says
undefined method 'name', so that suggests you are calling the method
name for something.  It tells you that the object you are calling it
on is a Post object.  Have a look at your code, can you see where the
error is being generated?  Assuming that you can see that you are
calling name on a Post object, does Post have a method called name?
Assuming that Post is an ActiveRecord model then is the posts table
supposed to have a name column?  If so does it have such a column?

Colin

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to