undefined method `posts_path'

Have you worked right through railstutorial.org already?

Colin

John

It looks ok. Can you post your models/post.rb file, the error message you are getting, the stack trace, and the relevant section of code where the error is generated (I know you have posted this previously but copy it and paste it again just so we have everything together). Tell us which line in the source is the one referred to in the error. Copy from your actual files so we make sure there are no typos. If while doing this you realise that the error is not actually the same one you were getting previously then try to work it out before posting.

Also check that the database does now actually contain the posts table with the correct columns.

Colin

No.I followed yet it from Agile web development with Rails (Pdf).Does

everything seems right with coding part?

It looks ok. Can you post your models/post.rb file,

model/post.rb file looks like:

class Post < ActiveRecord::Base

end

the error message

you are getting, the stack trace, and the relevant section of code

where the error is generated

(I know you have posted this previously

but copy it and paste it again just so we have everything together).

Tell us which line in the source is the one referred to in the error. In /app/view/try.htm…erb file generate error at line number 8

which is

<%= f.text_field :name %>

Copy from your actual files so we make sure there are no typos. If

while doing this you realise that the error is not actually the same

one you were getting previously then try to work it out before

posting.

Also check that the database does now actually contain the posts table

with the correct columns. Posts table exist in database but there is no column for name,title

and content even after “rake db:migrate”,it couldn’t generate.

John

If your migration didn't run, then how do you expect this to work any better than before?

And your previously posted migration code was trying to *create* a table that apparently already exists, which is pretty much guaranteed to fail :slight_smile:

You might want to read up on migrations at this point...

FWIW,

>> Also check that the database does now actually contain the posts table >> with the correct columns.

> Posts table exist in database but there is no column for name,title > and content even after "rake db:migrate",it couldn't generate.

If your migration didn't run, then how do you expect this to work any better than before?

      But to run a migration "rake db:migrate" is right command ,still it       didn't run .why?

And your previously posted migration code was trying to *create* a table that apparently already exists, which is pretty much guaranteed to fail :slight_smile:

  Yes table already exist but migration didn't run so columns are not   added in table.

John

I checked out this and it seems ok with my migration coding part

Active Record Migrations — Ruby on Rails Guides

John

That's what error messages tell you. But you have to read them.

But to run a migration “rake db:migrate” is right command ,still

it didn’t run .why?

That’s what error messages tell you. But you have to read them.

I checked out this and it seems ok with my migration coding part

http://guides.rubyonrails.org/migrations.html

But to run a migration “rake db:migrate” is right command ,still

it didn’t run .why?

That’s what error messages tell you. But you have to read them.

Problem is solved.