app/controllers/api_controller/renderer.rb
#
# Helper proc for rendering a collection of type specified.
#
Helper proc for rendering a collection of type specified.
Helper proc for rendering a collection of type specified .
def resource_to_jbuilder(type, reftype, resource, opts = {})
      reftype = get_reftype(type, reftype, resource, opts)
      json    = Jbuilder.new
      json.ignore_nil!
      normalize_options = {:add_href => true}
      pas = physical_attribute_selection(resource)
      normalize_options[:render_attributes] = pas if pas.present?
      add_hash json, normalize_hash(reftype, resource, normalize_options), :render_resource_attr, resource
      if resource.respond_to?(:attributes)
        expand_virtual_attributes(json, type, resource)
        expand_subcollections(json, type, resource)
      end
      expand_actions(resource, json, type, opts)
      expand_resource_custom_actions(resource, json, type)
      json
    end
def resource_to_jbuilder ( type , reftype , resource , opts = { } ) reftype = get_reftype ( type , reftype , resource , opts ) json = Jbuilder . new json . ignore_nil! normalize_options = { :add_href => true } pas = physical_attribute_selection ( resource ) normalize_options [ :render_attributes ] = pas if pas . present? add_hash json , normalize_hash ( reftype , resource , normalize_options ) , :render_resource_attr , resource if resource . respond_to? ( :attributes ) expand_virtual_attributes ( json , type , resource ) expand_subcollections ( json , type , resource ) end expand_actions ( resource , json , type , opts ) expand_resource_custom_actions ( resource , json , type ) json end
Helper proc for rendering a collection of type specified.
Helper proc for rendering a collection of type specified .
type
<not_specific>
reftype
<not_specific>
resource
<not_specific>
opts
<not_specific>