jbuilder
jbuilder copied to clipboard
Couldn't find template for digesting
I am getting an warning/error message - "Couldn't find template for digesting" for my partials while using json.cache! in 2.6.0, but everything works for me.
I am having a hard time finding an explanation online. Can anyone help me out here?
Got this warning too in my log files, but I found a solution / the reason for this. I have an api backend with different namespaces. In my templates I use "json.partial! 'TEMPLATE', VARS". Following this syntax I receive these warnings. But if I provide the full path to the partial ( "json.partial! 'my/path/to/template', VARS" ), everything works fine.
Update: I only get this warnings while using "json.cache!" syntax.
how are you providing full path exactly?
Stumbled on this issue after debugging and resolving the issue myself within a namespaced api backend as well. Rails is rendering it properly even though its being logged. Oddly enough, I still see the error in the logs even if I comment out the guilty line within the json.cache! block.
Providing the fully-qualified relative path within the views directory, the error messaging goes away:
partial: 'bar' vs partial: 'my/namespace/foo/bar'
on Rails 6.0.3.3 and jbuilder (2.10.1)