I am attempting to render a partial jbuilder file using the below
json.(@request, :id)
json.profile do
json.partial! partial: 'users/user_reduced', user: @request.user
end
the partial is below (users/_user_reduced.json.jbuilder)
json.(user, :id, :name, :sex)
However, I get the error:
ActionView::Template::Error (undefined local variable or method `user' for #<#<Class:0x007fe4ebc91878>:0x007fe4ebe599f8>):
It's as if the local user variable is not being set. What is the syntax for setting a local variable to a jbuilder partial path?