Skip to content

Commit

Permalink
Removed limit from comments listed.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmckissock committed Jun 17, 2024
1 parent 72c84a7 commit e9e29e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/articles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def index

def show
@article = Article.find(params[:id])
@comments = @article.comments.order(created_at: :desc).limit(20)
@comments = @article.comments.order(created_at: :desc)
@comment = Comment.new
end

Expand Down
13 changes: 13 additions & 0 deletions app/views/users/articles_written.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<h1>user.name 's' Articles</h1>
<ul>
<% user.articles.each do |article| %>
<li>
<%= link_to article.title, article.link %> - Posted by <%= link_to article.user.name, article.user %> on <%= article.created_at.strftime("%B %d, %Y at %I:%M %p") %>
<div>
<%= link_to "comment", article %>
</div>
</li>
<% end %>
</ul>

<%= paginate @articles %>

0 comments on commit e9e29e4

Please sign in to comment.