I’m curious to know if you’ve ever experienced this peculiar sensation when encountering helpers with the same names as their corresponding controllers, immediately after employing the
rails g controller command.
Upon executing the
rails g controller foo command, both
foo_helper are generated. This scenario has consistently led me to believe that helpers are somewhat “linked” to controllers, implying that the methods within
foo_helper should exclusively be utilized within the views of
foo_controller. However, this perspective is incorrect, given that the default value of
include_all_helpers is set to true.
In my viewpoint, it would be more logical for this behavior of generating
foo_helper to persist only when
include_all_helpers is set to false.
It appears that this behavior might have been overlooked over time, particularly considering that the default value of
include_all_helpers was false in the past.
I appreciate it if you’re able to share your thoughts. I’m eager to learn more, especially since I’m new to the world of Rails.