-
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
Add views layouts #7
Conversation
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 @geekelo ,
Good job so far!
There are some issues that you still need to work on to go to the next project but you are almost there!
Highlights
✔️ Added views for the post and user controller actions.
✔️ Added a way to navigate from one page to another.
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.
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/b6d75d35-5613-4fec-a23f-533ac2c40af6) | ||
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/072ef998-2566-4116-a21c-edd58af433da) | ||
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/8e31087f-f384-46f0-9f9f-befc87ebd8b1) | ||
|
||
|
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.
- @geekelo Great work on your readme, however, I noted your MIT license is currently a template that helps you write MIT license, kindly consider customizing it to suit your project, and also to give users legal authority to use your code.
<%= stylesheet_link_tag 'users', media: 'all', 'data-turbolinks-track': 'reload' %> | ||
<body> | ||
<div id="user"> | ||
<img id="user-image" src="<%= user.photo %>" alt="User Photo" width="200"> | ||
<article id="user-details" class="container"> | ||
<h1><%= user.name %></h1> | ||
<p class="counts">Number of posts: <%= user.posts_counter.nil? ? 0 : user.posts_counter %></p> | ||
<article> | ||
</div> | ||
</body> |
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.
@geekelo Great work using partials to render users, this will ensure your code will be easier to scale and also easy to read.
No users | ||
<% else %> | ||
<% @users.each do |user| %> | ||
<%= link_to user_path(user) do %> | ||
<%= render user %> | ||
<% end %><br> | ||
<% end %> | ||
<% 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.
- @geekelo I am getting the error below when I try to access the users' page, to fix it you can delete the 4th line code from your manifest.js file, you currently don't have a directory called vendors in the assets folder that's why the error is showing
<% @posts.each do |post| %> | ||
<a href ="<%= user_post_path(@user, post)%>"><%= render post%></a> | ||
<%= "no comments for this post" if post.comments.empty?%> | ||
<div class="comments"> | ||
<% post.recent_comments.each do |comment|%> | ||
<%=render comment%> | ||
<% end %> | ||
<p id="view-post"><%= link_to 'View Post', user_post_path(@user, post) %></p> | ||
</div> | ||
|
||
<div class="button-container"> | ||
<button>See all posts</a></button> | ||
</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.
- @geekelo Great work in adding the views to your project, however am unable to access the user's post index page, am getting the error below, this is because you are using render and you don't have a partial view to display comments.
<%= render @user %> | |
<% @posts.each do |post| %> | |
<a href ="<%= user_post_path(@user, post)%>"><%= render post%></a> | |
<%= "no comments for this post" if post.comments.empty?%> | |
<div class="comments"> | |
<% post.recent_comments.each do |comment|%> | |
<%=render comment%> | |
<% end %> | |
<p id="view-post"><%= link_to 'View Post', user_post_path(@user, post) %></p> | |
</div> | |
<div class="button-container"> | |
<button>See all posts</a></button> | |
</div> | |
<% end %> | |
<%= render @user %> | |
<% @posts.each do |post| %> | |
<a href ="<%= user_post_path(@user, post)%>"><%= render post%></a> | |
<%= "no comments for this post" if post.comments.empty?%> | |
<div class="comments"> | |
<% post.recent_comments.each do |comment|%> | |
<li> <%= comment.text %> </li> | |
<% end %> | |
<p id="view-post"><%= link_to 'View Post', user_post_path(@user, post) %></p> | |
</div> | |
<div class="button-container"> | |
<button>See all posts</a></button> | |
</div> | |
<% end %> |
448483a
to
81d0bec
Compare
b4f4065
to
3ffaf6a
Compare
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 @geekelo,
Great work on making the changes requested by a previous reviewer 👏
You've done well implementing some of the requested changes, but there are still some which aren't addressed yet.
Highlights
*Tried to implement the changes requested by the previous reviewer. ✔️
Required Changes ♻️
Check the comments under the review.
Optional suggestions
Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.
You can also consider:
- Please kindly check my inline comment.
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 @topeogunleye 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.
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/b6d75d35-5613-4fec-a23f-533ac2c40af6) | ||
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/072ef998-2566-4116-a21c-edd58af433da) | ||
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/8e31087f-f384-46f0-9f9f-befc87ebd8b1) | ||
|
||
|
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 @geekelo,
First off, great job on your project so far! The effort and dedication you've put into it is evident. 👏
However, while reviewing, I noticed that a change requested by the previous reviewer concerning the MIT license in your README hasn't been addressed.
Change Requested:
The MIT license in your README appears to still be in its template form. It's essential for the license to be customized and tailored to your project. This not only adds a professional touch but also grants users the proper legal authority to use your code.
Please take a moment to update this section to reflect the appropriate details for your project.
Keep pushing forward, and let's make this adjustment to proceed!
Happy Coding! 🚀👨💻👩💻
<%= "no comments for this post" if @post.comments.empty?%> | ||
<div class="comments"> | ||
<% @post.comments.each do |comment|%> | ||
<%=render comment %> |
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 @geekelo,
Great job on the progress you've made with your project, especially in adding the views. Your dedication and hard work are commendable. 👏
However, there's a persistent issue from the previous review that still needs to be addressed:
Change Requested:
As per the previous feedback, there's an error when trying to access the user's post index page. This issue seems to stem from this line in your code:
<%=render comment %>
Given that there isn't a comment
partial (i.e., _comment.html.erb
) in your views directory, this line will throw an error when there are comments for a post.
To resolve this, you have a couple of options:
- Create a Comment Partial: If you intend to use a partial for comments, create a
_comment.html.erb
partial in the appropriate views directory and populate it with the necessary content to display each comment. - Directly Display Comments: If you don't wish to use a partial, you can directly display each comment's content within the loop, replacing the render line.
Please address these concerns and test your view to ensure that the issues are resolved. Keep up the good work, and don't get discouraged. Every challenge is a stepping stone to mastery!
Best of luck with your coding journey! 🚀👨💻👩💻
app/views/posts/show.html.erb
Outdated
<%=render comment %> | ||
<% end %> | ||
<div class="button-container"> | ||
<button>Pagination</a></button> |
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 @geekelo,
Great job on the progress you've made with your project, especially in adding the views. Your dedication and hard work are commendable. 👏
However, there's an issue that needs to be addressed:
- [OPTIONAL] Also, kindly fix the mismatched tags in
<button>Pagination</a></button>
. Ensure that you use consistent opening and closing tags.
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 @geekelo,
Good job so far!
Highlights!
- Good code organization and partial use ✔️
- Descriptive README ✔️
Great work on making the changes requested by a previous reviewer 👏
You've done well implementing some of the requested changes, but there are still some which aren't addressed yet.
Required Changes ♻️
Check the comments under the review.
Optional suggestions
Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
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.
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/b6d75d35-5613-4fec-a23f-533ac2c40af6) | ||
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/072ef998-2566-4116-a21c-edd58af433da) | ||
![image](https://github.com/geekelo/rails-blog_app/assets/102464578/8e31087f-f384-46f0-9f9f-befc87ebd8b1) | ||
|
||
|
||
## 🛠 Built With <a name="built-with"></a> | ||
|
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 @geekelo ,
Your project is complete! There is nothing else to say other than... it's time to merge it
Congratulations! 🎉 🎉 🎉
Highlights
✔️ Implemented the change requested to ensure the MIT license is customized as requested.
Optional suggestions
Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.
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.
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.
Implement the design from the sneak peek wireframes.
Implement minimal styling
Analyze the wireframes deeply and identify all the necessary elements and how a user would navigate from one page to another
All Users page wireframe Single User page wireframe
All Posts by a given User page wireframe Single Post page wireframe