Hi.
I found that json.cache! was not working when I was using jbuilder template with gon.jbuilder.
I found this error message:
undefined method controller' for #<StaffsController:0x007f984fb67440> Did you mean? controller_path
The error comes from this line.
https://github.com/rails/jbuilder/blob/master/lib/jbuilder/jbuilder_template.rb#L35
I think this problem will be fixed by changing the argument controller to right one.
(controller is equal to @context on JbuilderTemplate)
https://github.com/gazay/gon/blob/master/lib/gon/jbuilder/parser.rb#L69
Is it hard to replace it?
And is there other way to use json.cache! when using gon.jbuilder?
Thanks.
Hi.
I found that
json.cache!was not working when I was using jbuilder template withgon.jbuilder.I found this error message:
undefined method controller' for #<StaffsController:0x007f984fb67440> Did you mean? controller_pathThe error comes from this line.
https://github.com/rails/jbuilder/blob/master/lib/jbuilder/jbuilder_template.rb#L35
I think this problem will be fixed by changing the argument
controllerto right one.(
controlleris equal to@contextonJbuilderTemplate)https://github.com/gazay/gon/blob/master/lib/gon/jbuilder/parser.rb#L69
Is it hard to replace it?
And is there other way to use
json.cache!when usinggon.jbuilder?Thanks.