I have three controllers. I have defined two controllers to goven the
site functions. However I want to have a homepage Controller. Part of
the controller will call methods from other controllers. For example it
will get the last 5 blog posts and it will get the top 5 most discussed
articles, and display it on the homepage. I will also have some
specific homepage modules being displayed on the page.
I am trying to do something like this :
class HomepageController < ApplicationController
@blog_contents = BlogController.list
@article_most_discussed = ArticleController.list
But it does not seem to work. How do I reference methods in other
controllers ? Is it done ? I can replicate the code in this controller,
but that will be messy.
Thanks in advance.