I have a model called comment which has the typical stuff like
belongs_to :post, author, email, body and a posts controller with the
method add_comment.
How do I wire it up so that when I'm on localhost:3000/posts/24/ and
hit the submit button, it will either:
A) Add a new comment with the right post_id
B) Redirect back to localhost:3000/posts/24/ with an error message if
all required fields are not filled out.
I need /posts/24/comments to look exactly the same as /posts/24,
except with error messages for validating the comment fields.
However, I get this weird artifact where the comment I filled out
partially shows up on /posts/24/comments.
Also, comments only needs add and delete so I figured I should make it
a model without a controller and just have posts_controller do the add
and admin_controller do the delete. Is there a way to achieve this?