Sha256: 3828404ea6147b17b3bdd75f2314fc796d44bbbe2fb946c05fe6d7718dc30f4f

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

module MakeRestful::Rendering

  private

  ## Rendering
  def render(options = {}, deprecated_status = nil, &block)

    super and return if template_exists?([params[:controller], params[:action]].join('/')) && allow_format?(formats) unless options[:load_template] == false

    # Set the response from the chain
    response = @response || @instance || @collection

    respond_to do |format|
      format.json { super json: response, status: @status, callback: ( params[:callback] if allow_format? :jsonp )} if allow_format? :json, :jsonp
      format.xml  { super xml:  response, status: @status } if allow_format? :xml
      format.any  { super }
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
make_restful-0.1.2 lib/make_restful/rendering.rb