-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Milestone 6: views #6
Conversation
- '#index' to fetch all users. - '#show' to find a user by id.
- Add max-width to main element. - Update partial path. - Add partial's local variables 'truncate_n' and 'limit_n'.
- Render 'user_card' partial. - Render 'posts' partial. - Render 'button_link' partial.
- Render 'posts' partial. - Wrap 'posts' partial in 'main'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ITurres,
Good job so far, indeed you have spent time on this project!
There are some issues that you still need to work on to go to the next project but you are almost there!
Highlights
- Linters passed ✔️
- Readme file professional ✔️
- All views code works ✔️
Required Changes ♻️
Check the comments under the review.
Optional suggestions
Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.
Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
<% if limit_n > 0 %> | ||
<div class="card card-body mt-1 p-3"> | ||
<ul class="list-unstyled"> | ||
|
||
<% post.most_recent_comments(limit_n).each do |comment| %> | ||
<li><%= comment.author.name %>: <%= comment.text %></li> | ||
<% end %> | ||
|
||
</ul> | ||
</div> | ||
<% end %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Olamarx! it is running well on my end! 🎯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It runs well on my end too, just the comments were not added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Olamarx, a short screencast
addind-data-to-blog-db-dev.webm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Olamarx, the reason for the issue is that when instantiating the Comment
model, it expects author
as a parameter. However, in your instantiations, you're sending user
instead of author
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e
Comment.create(post: first_post, author: first_user, text: 'Hi Tom!' )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ITurres 😃,
Your project is complete! There is nothing else to say other than... it's time to merge it
Congratulations! 🎉
Highlights
- Well done on working on this project so far. All is good. 💯
Cheers, and Happy coding!👏👏👏
Feel free to mention @MahmoudBakr23 to leave any questions or comments in the PR thread if something is not 100% clear.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
Hello @MahmoudBakr23! thank you for having reviewed and approved the PR :D, have a good week! |
Pull Request Summary for Milestone 6 Completion
Added:
/app/views/posts/_posts.html.erb
@posts
variable./app/views/shared/_button_link.html.erb
/app/views/shared/_user_card.html.erb
user_path(user)
.Modified:
/README.md
controllers specs
task as completed./Gemfile
and/Gemfile.lock
faker
gem for generating test data in development mode./app/controllers/posts_controller.rb
index
method to conditionally set@posts
to display all posts or only those of the current user.show
method to set@post
for the current user's post./app/controllers/users_controller.rb
index
method, set@users
to display all users.show
method to set@user
based on the current user's params./app/views/layouts/application.html.erb
/app/views/posts/index.html.erb
shared/button_link
partial for pagination./app/views/posts/show.html.erb
posts
partial./app/views/users/index.html.erb
user_card
partial to display all users./app/views/users/show.html.erb
user_card
partial.shared/button_link
partial to navigate to 'see all posts'.Thank you for reviewing this PR. Feel free to reach out on Slack as Arturo (Arthur) Emanuel Guerra Iturres for any queries or further assistance. 🌟