2023-02-21 01:12:13 -08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-12-07 11:51:44 -08:00
|
|
|
class QuestionController < ApplicationController
|
|
|
|
def show
|
|
|
|
@question = Question.find(params[:id])
|
2023-02-21 01:12:13 -08:00
|
|
|
@answers = @question.cursored_answers(last_id: params[:last_id], current_user:)
|
2020-04-20 14:03:57 -07:00
|
|
|
@answers_last_id = @answers.map(&:id).min
|
2023-02-21 01:12:13 -08:00
|
|
|
@more_data_available = !@question.cursored_answers(last_id: @answers_last_id, size: 1, current_user:).count.zero?
|
2020-04-20 14:03:57 -07:00
|
|
|
|
2015-01-03 10:24:51 -08:00
|
|
|
respond_to do |format|
|
|
|
|
format.html
|
2022-09-08 14:09:59 -07:00
|
|
|
format.turbo_stream { render layout: false, status: :see_other }
|
2015-01-03 10:24:51 -08:00
|
|
|
end
|
2014-12-07 11:51:44 -08:00
|
|
|
end
|
|
|
|
end
|