retrospring/app/controllers/public_controller.rb

15 lines
433 B
Ruby
Raw Normal View History

2014-12-11 06:39:35 +01:00
class PublicController < ApplicationController
2020-04-19 01:45:50 +02:00
before_action :authenticate_user!
2014-12-12 17:54:13 +01:00
2014-12-11 06:39:35 +01:00
def index
@timeline = Answer.cursored_public_timeline(last_id: params[:last_id])
@timeline_last_id = @timeline.map(&:id).min
@more_data_available = !Answer.cursored_public_timeline(last_id: @timeline_last_id, size: 1).count.zero?
2014-12-11 06:39:35 +01:00
respond_to do |format|
format.html
2020-05-09 04:39:09 +02:00
format.js { render layout: false }
2014-12-11 06:39:35 +01:00
end
end
end