class ApplicationViewComponent < ViewComponent::Base
include ApplicationHelper
end
class FooComponent < ApplicationViewComponent
end
How can I include not only ApplicationHelper but also user created all helper files in view component?
class ApplicationViewComponent < ViewComponent::Base
include ApplicationHelper
end
class FooComponent < ApplicationViewComponent
end
How can I include not only ApplicationHelper but also user created all helper files in view component?
Copyright © 2021 Jogjafile Inc.
You don't include all the helpers.
Use the
helpersproxy instead to access your Rails helpers.And use
delegateif you want to simplify the calls:Only include the helper modules when actually needed.