In Rails 5+ you can access a helper from a controller using the helpers
method:
# Inside a controller action
helpers.link_to 'Foo', foo_path
In older Rails versions you can use view_context
instead:
# Inside a controller action
view_context.link_to 'Foo', foo_path
Posted by Henning Koch to makandra dev (2023-02-15 09:21)