We have Questions
and Answers
, and every Question has_many :answers
and those answers belongs_to :questions
.
I want to display the CURRENT count of answers on the CURRENT Question.
i tried in my Answers_Controller :
def show
@question = Question.find(params[:question_id])
@answers_count = @question.answers.count
end
and then called on my view <%= @answers_count %>
.
But i think i'm missing something here, because nothing is Displayed.