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

8 lines
380 B
Plaintext

$('#notifications').append('<% @notifications.each do |notification|
%><%= j render 'notifications/notification', notification: notification
%><% end %>');
<% if @notifications.next_page %>
$('#pagination').html('<%= j will_paginate @notifications, renderer: BootstrapPagination::Rails, page_links: false %>');
<% else %>
$('#pagination, #load-more-btn').remove();
<% end %>