retrospring/app/views/inbox/show.js.erb

9 lines
362 B
Text
Raw Normal View History

2015-02-12 22:09:11 +01:00
$('#entries').append('<% @inbox.each do |i|
%><%= j render 'inbox/entry', i: i
2015-02-12 21:59:46 +01:00
%><% end %>');
2015-02-12 22:10:50 +01:00
<% if @inbox.next_page %>
2015-02-12 21:59:46 +01:00
$('#pagination').html('<%= j will_paginate @inbox, renderer: BootstrapPagination::Rails, page_links: false %>');
<% else %>
$('#pagination, #load-more-btn').remove();
2015-02-12 22:09:11 +01:00
<% end %>
2015-02-28 17:29:10 +01:00
<% Inbox.where(id: @inbox.pluck(:id)).update_all(new: false) %>