app/controllers/home_controller.rb
# Return the appropriate Question collection for to the selected tab.
Return the appropriate Question collection for to the selected tab.
Return the appropriate Question collection for to the selected tab .
def questions
    @questions_tabs ||= {
      mine: -> { current_user.questions },
      unanswered: -> { Question.where(answers_count: 0) }
    }
    @questions_tabs.fetch(tabs.selected, -> { Question }).call
  end
def questions @questions_tabs ||= { mine : -> { current_user . questions } , unanswered : -> { Question . where ( answers_count : 0 ) } } @questions_tabs . fetch ( tabs . selected , -> { Question } ) . call end
Return the appropriate Question collection for to the selected tab.
Return the appropriate Question collection for to the selected tab .