-
-
Save anonymous/4ad05f0162aecd2c5a13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if @feed_item.any? %> | |
<ol class="posts"> | |
<%= render partial: 'shared/feed_item', collection: @feed_item, as: :my_item %> | |
</ol> | |
<%= will_paginate @feed_item %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li id="<%= my_item.id %>"> | |
<span class="user"> | |
<%= link_to my_item.user.name, my_item.user %> | |
</span> | |
<span class="content"><%= my_item.content %></span> | |
<span class="timestamp"> | |
Posted <%= time_ago_in_words(my_item.created_at) %> ago. | |
</span> | |
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if signed_in? %> | |
<%= render 'shared/feed'%> | |
<% else %> | |
<%= render 'shared/feed'%> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def home | |
if signed_in? | |
@post = current_user.posts.build if signed_in? | |
@user_items = current_user.feed.paginate(page: params[:page], :per_page => 12) if signed_in? | |
else | |
@all_items = Post.all.paginate(page: params[:page], :per_page => 5) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment