module Spree::Api::Responders::RablTemplate

Public Instance Methods

api_behavior() click to toggle source
Calls superclass method
# File lib/spree/api/responders/rabl_template.rb, line 19
def api_behavior
  if controller.params[:action] == 'destroy'
    # Render a blank template
    super
  end
end
template() click to toggle source
# File lib/spree/api/responders/rabl_template.rb, line 15
def template
  options[:default_template]
end
to_format() click to toggle source
Calls superclass method
# File lib/spree/api/responders/rabl_template.rb, line 5
def to_format
  if template
    render template, status: options[:status] || 200
  else
    super
  end
rescue ActionView::MissingTemplate => e
  api_behavior
end