cells-rails icon indicating copy to clipboard operation
cells-rails copied to clipboard

Delegates doesn't work for ActionView::Helpers and Webpacker::Helper

Open pvcarrera opened this issue 8 years ago • 1 comments

The Trailblazer cells documentation http://trailblazer.to/gems/cells/rails.html#asset-helper suggests that action view helpers can be included using delegation delegates :parent_controller, :image_tag

I tried to use this approach to include the csrf_meta_tags stylesheet_pack_tag, javascript_pack_tag helpers in my Layout cell but it didn't work (method missing).

Then I tried to include these helpers to my cell using include and it worked fine:

module MyProject::Cell
  class Layout < Trailblazer::Cell
    include ActionView::Helpers::CsrfHelper
    include Webpacker::Helper
  end
end

Ah, almost forgot 😄 , Rails version: 5.1.4

Is this something that needs to be updated in the documentation?

pvcarrera avatar Jan 16 '18 10:01 pvcarrera

That should definitely be in the docs, now that I hit this issue myself! :sweat_smile:

apotonick avatar Jan 12 '20 10:01 apotonick