我有一个rails应用程序,用户可以注册/登录和发布故事,关注其他作者,我想要实现的是如何在用户之间放置一些内容,如Authors to follow
。滚动(就像Twitter对Who to follow
所做的那样。
with react我创建了一个User_Follow_suggestion_container:
<%= react_component('FollowSuggestionsContainer') %>
它工作正常,现在我想知道,在哪里放置它,所以它可以随机地或在向下滚动到10或15个帖子之后。
my dashboard.html.erb
<div class="col-md-6 col-md-offset-1 dashboard-main-content">
<% unless @dashboard.top_stories? %>
<% if user_signed_in? && current_page?('/') %>
<div data-animation="fadeInUp-fadeOutDown">
<%= render 'shared/inline_editor' %>
</div>
<% end %>
<div class="posts-wrapper" data-behavior="endless-scroll" data-animation="fadeInUp-fadeOutDown">
<%= render @dashboard.posts %>
</div>
<% else %>
<div class="posts-wrapper" data-animation="fadeInUp-fadeOutDown">
<%= render 'posts/top_stories', posts: @dashboard.posts %>
</div>
<% end %>
<% unless @dashboard.top_stories? %>
<div class="center">
<%= will_paginate @dashboard.posts %>
</div>
<% end %>
</div>
<%= react_component('FollowSuggestionsContainer') %>