lib/rails/boost/jbuilder/render_path.rb
# Render the JSON inside the block only if the given key is in the render
# path specified by the template that rendered the partial.  E.g.:
#
# Parent template
# ===============
# json.partial!('wibbles', locals: {
#   wibble: @wibble,
#   render_path: { wibble: { foo: true } }
# })
#
# Partial _wibbles.json.jbuilder
# ==============================
# json.href(wibbles_path(wibble))
# json.auth(%i[read])
# json.render_path!(:wibble) do
#   json.something(wibble.something)  # => rendered
#   json.render_path!(:foo, wibble.foo) do
#     json.something(foo.something)  # => rendered
#     json.render_path!(:bar, foo.bar) do
#       json.something(bar.something)  # => not rendered
#     end
#   end
# end
Render the JSON inside the block only if the given key is in the render
path specified by the template that rendered the partial.

Parent template






Render the JSON inside the block only if the given key is in the render path specified by the template that rendered the partial . Parent template
def render_path!(target, value = nil)
        if _has_render_path_for?(target)
          _with_path_value(target, value) do
            _render_path_scope(render_path[target]) do
              merge!(_scope { yield })
            end
          end
        end
      end
def render_path! ( target , value = nil ) if _has_render_path_for? ( target ) _with_path_value ( target , value ) do _render_path_scope ( render_path [ target ] ) do merge! ( _scope { yield } ) end end end end
Render the JSON inside the block only if the given key is in the render
path specified by the template that rendered the partial.
Render the JSON inside the block only if the given key is in the render path specified by the template that rendered the partial .
target
value