Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. def show
  2. @posts = @group.posts.order(upd_at: :desc).includes(:user).includes(comments: :user).paginate(page: params[:page], per_page: 10)
  3. end
  4.  
  5. <h1>Groupe <%= @group.name %></h1>
  6. <div class="post_list<%=@group.id%>">
  7. <%= render @posts %>
  8. </div>
  9. <%= will_paginate @posts, renderer: BootstrapPagination::Rails %>
  10.  
  11. <% @comments = post.comments %>
  12. <ul id="comment_list<%=post.id%>">
  13. <%- if @comments.any? %>
  14. <%= render @comments, post: post %>
  15. <%= will_paginate @comments, renderer: BootstrapPagination::Rails %>
  16. <% end %>
  17. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement