I am very new to ruby. I have one doubt, how to call a controller method from a view.
my controller
def course_user_count @courses
At the top of your controller you can mark the method that you want available to your views as a helper method:
helper_method :course_user_count
Then in your view, you can call course_user_count and store the result.
<% count = course_user_count %>