Imagine we need (for some reason) a helper that shuffles the characters of a string and we want it to be available in our views.

    There is NO coupling between the file name and the name of the module. We can define this code where and how we want.

    1. # apps/web/application.rb
    2. module Web
    3. class Application < Hanami::Application
    4. configure do
    5. 'helpers',
    6. 'controllers',
    7. 'views'
    8. ]
    9. # ...
    10. view.prepare do
    11. include Hanami::Helpers
    12. include Web::Helpers::Shuffler
    13. end
    14. end
    15. end

    Please note that our custom helper will work even if we remove the include Hanami::Helpers line, because it’s just Ruby.