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

9 lines
362 B
Plaintext
Raw Normal View History

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