Document how the ActionView helpers allowlist works
jaredcwhite opened this issue · 4 comments
Most ActionView helpers are blocked from use within Bridgetown (because some don't work well or have conflicts), but this is configurable and should be documented so folks can tweak accordingly.
@jaredcwhite I was just about to open a PR to change this bc I didn’t know this was an option. How would one go about it? I can open a doc PR if it works!
@andrewmcodes So when you include Bridgetown::ViewComponentHelpers
in your VCs, that runs through a list of ActionView helpers and actually removes them from the instance methods available. To skip removing certain helpers you want to use, you'd add a call within your VC class (or in a base class should do the trick):
allow_rails_helpers :helper_one, :helper_two
You'll find that all in the ViewComponentHelpers
class definition.
This is all because a bunch of stuff in ActionView assumes Rails is around and breaks, or conversely it interferes with Bridgetown helpers. Perhaps over time we can expand the default allow list as we test various scenarios.
Ahhhh I see
You'll find that all in the ViewComponentHelpers class definition.
Makes sense! I had the code up on a private branch and everything so glad I saw this.
I'll give it a try and open a PR.