Project Challenge: Display Comments
Modify views to display user comments.
We'll cover the following
Problem statement
In this challenge, you simply have to display all the comments for a particular link on its show
view. You must also display the email
attribute of the user who submitted the comment.
A comment will look like this:
user@email.com Commented: commenting is fun
user@email.com
and the body of the comment,commenting is fun
, are retrieved from the database.Commented:
is simple HTML text.
Important concepts
- We store the content of a comment in
comment.body
- Each comment is associated with a link. You must keep this association in mind to access the comments for a particular link.
- You will not be passing a
@comment
instance variable. Instead, you will be passing@link
as your instance variable.
Implementation
Get hands-on with 1400+ tech skills courses.