This blog is part of our Rails 5 series.
Before Rails 5, when we wanted to use any of the helper methods in controllers we used to do the following.
Though this works, it adds all public methods of the included helper module in the controller.
This can lead to some of the methods in the helper module conflict with the methods in controllers.
Also if our helper module has dependency on other helpers, then we need to include all of the dependencies in our controller, otherwise it won’t work.
New way to call helper methods in Rails 5
In Rails 5, by using the new instance level helpers method in the controller, we can access helper methods in controllers.
This removes some of the drawbacks of including helper modules and is much cleaner solution.