Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json.cache! is not working when using gon.jbuilder #247

Open
nullnull opened this issue May 28, 2018 · 1 comment
Open

json.cache! is not working when using gon.jbuilder #247

nullnull opened this issue May 28, 2018 · 1 comment

Comments

@nullnull
Copy link

nullnull commented May 28, 2018

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.

@gazay
Copy link
Owner

gazay commented Jul 11, 2018

Hello! I'm not sure as I didn't touch jbuilder parsing code for a long time and didn't plan to do so in near future. But if you find out that it is possible and will be compatible with old behavior - we can try to fix it

Thank you for issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants