app/helpers/application_helper.rb
# If the question has a best answer, return permalink to that answer.
# Otherwise, return the question path.
If the question has a best answer, return permalink to that answer.
Otherwise, return the question path.
If the question has a best answer return permalink to that answer . Otherwise return the question path .
def question_answers_highlight_path(question)
    if question.best_answer_id.present?
      answer_permalink_path(question.best_answer_id)
    else
      question_path(question, anchor: 'answers')
    end
  end
def question_answers_highlight_path ( question ) if question . best_answer_id . present? answer_permalink_path ( question . best_answer_id ) else question_path ( question , anchor : 'answers' ) end end
If the question has a best answer, return permalink to that answer.
If the question has a best answer return permalink to that answer .
question