Closed zhengpd closed 1 year ago
hello @ericbeansmile, I've run into the same problem. Where and how have you overriden the tree method? thanks!
@jvalentino90 You can create config/initializers/action_view.rb
with following content:
module ActionView
class Digestor
def self.tree(name, finder, partial = false, seen = {})
# copy original method body from https://github.com/rails/rails/blob/aa1ba9cb244b1e03d36aaa941ae4e91c6713b77e/actionview/lib/action_view/digestor.rb#L47
end
end
end
Inside the method body just make change like my comment above.
Closing stale issue.
I saw some digesting errors when using "extends" in the rabl template:
The template is like:
After some research I believe this is caused by how ActionView::Digestor build the dependency tree:
Look the
node.children << tree(dep_file, finder, true, seen)
here. It treats every dependency it found in template as partial, so it tries to find the partial file asfoo/_bar
in my example, notfoo/bar
as expected. I override thetree
method as following for quick fix:However I wonder there's more elegant way other than this to avoid digesting errors.