title: calling a controller method from view Ruby on rails
body: <p>I am very new to ruby. I have one doubt, how to call a controller method from a view. </p>
  
  <p><strong>my controller</strong></p>
  
  <pre><code>def course_user_count
   @courses=Course.all
   @courses.each do |course|
   @count=course.students.count
  end
  </code></pre>
  
  <p>I have to call this @count variable from the method in my view course.view.html.erb</p>