You have not told us which line the error points to but I guess it is
the one above. If so then it is saying that @post is nil, so your
find_by_id did not find anything. You don’t need to use find_by_id,
you can just use @post = Post.find( params[:id] )
Perhaps there is not a Post object with the correct id. If you look
in log/development.log you will see the params you are passing which
may give you a clue.
I suggest, however, that as a beginner you work right through a good
tutorial such as railstutorial.org (which is free to use online).
That will show you the basics of rails.
Also see the Rails Guides.
Colin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.