My code is starting to have duplicates.... because I don't know where to put methods/functions that need to be accessed by (2) different controllers, and just to get it up quickly I just duplicated it.
So I have a users_controller, and a pages_controller and posts_controller.
On the users page, I have posts being displayed.
On the homepage, I also have posts being displayed.
Where should I put shared/common code so that the users_controller and pages_controller and posts_controller can all have access to ithese methods?
Right now, I have duplicated def methods in some controllers, and also some duplicate private methods in each controller.
On a related note, how can I access methods defined in one controller from another controller?