Sha256: a403b55696489a75e4c62d82c255627a94702bd2225e8d2637f344768e736218

Contents?: true

Size: 486 Bytes

Versions: 31

Compression:

Stored size: 486 Bytes

Contents

module Spree
  module Api
    module Responders
      module RablTemplate
        def to_format
          if template
            render template, :status => options[:status] || 200
          else
            super
          end

        rescue ActionView::MissingTemplate => e
          api_behavior(e)
        end

        def template
          request.headers['X-Spree-Template'] || controller.params[:template] || options[:default_template]
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
spree_api-2.0.6 lib/spree/api/responders/rabl_template.rb
spree_api-1.3.4 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.5 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.4 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.3 lib/spree/api/responders/rabl_template.rb
spree_api-1.3.3 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.2 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.1 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.0 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.0.rc1 lib/spree/api/responders/rabl_template.rb
spree_api-1.3.2 lib/spree/api/responders/rabl_template.rb