Class: Answers::QuestionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/answers/questions_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#after_sign_in_path_for, #redirect_to_back

Instance Method Details

#indexObject



8
9
10
11
12
13
# File 'app/controllers/answers/questions_controller.rb', line 8

def index
  add_breadcrumb "Answers", answers_path
  
  @questions = Question.all
  respond_with(@questions)
end

#showObject



15
16
17
18
19
20
# File 'app/controllers/answers/questions_controller.rb', line 15

def show
  add_breadcrumb "Answers", answers_path
  add_breadcrumb @question.text, answer_path(@question)

  render locals: { question: @question, similar_questions: @question.similar(limit:3) }
end