Skip to content

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

@nullnull

Description

@nullnull

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions