Anda di halaman 1dari 9

2

post comment Classes Associations


post class Post.rb \blog\app\models

comment class comment.rb \blog\app\models

Dependency post


Rails console

post comments association:

Comments posts config directory routes. Rb

Validations

post.rb Validations
validates_presence_of :title
validates_presence_of :body

comment.rb Validations
validates_presence_of :post_id
validates_presence_of :body