Retrospring/app/views/static/index.js.erb

9 lines
361 B
Plaintext

$('#timeline').append('<% @timeline.each do |answer|
%><%= j render 'shared/answerbox', a: answer
%><% end %>');
<% if @timeline.next_page %>
$('#pagination').replaceWith('<%= j will_paginate @timeline, renderer: BootstrapPagination::Rails, page_links: false %>');
$('#pagination').hide();
<% else %>
$('#pagination, #load-more-btn').remove();
<% end %>