2014-12-10 21:39:35 -08:00
|
|
|
class PublicController < ApplicationController
|
2020-04-18 16:45:50 -07:00
|
|
|
before_action :authenticate_user!
|
2014-12-12 08:54:13 -08:00
|
|
|
|
2014-12-10 21:39:35 -08:00
|
|
|
def index
|
2020-04-20 14:03:57 -07:00
|
|
|
@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-10 21:39:35 -08:00
|
|
|
respond_to do |format|
|
|
|
|
format.html
|
2020-05-08 19:39:09 -07:00
|
|
|
format.js { render layout: false }
|
2014-12-10 21:39:35 -08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|