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

10 lines
399 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 %>');
<% if @more_data_available %>
$('#pagination').html('<%= j render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @inbox_last_id %>');
2015-02-12 12:59:46 -08:00
<% else %>
$('#pagination, #load-more-btn').remove();
2015-02-12 13:09:11 -08:00
<% end %>
<% Inbox.where(id: @inbox.pluck(:id)).update_all(new: false) %>