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.1.12 lib/spree/api/responders/rabl_template.rb
spree_api-2.1.11 lib/spree/api/responders/rabl_template.rb
spree_api-2.1.10 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.13 lib/spree/api/responders/rabl_template.rb
spree_api-2.1.9 lib/spree/api/responders/rabl_template.rb
spree_api-2.1.8 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.12 lib/spree/api/responders/rabl_template.rb
spree_api-2.1.7 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.11 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.10 lib/spree/api/responders/rabl_template.rb
spree_api-2.1.6 lib/spree/api/responders/rabl_template.rb
spree_api-2.2.0 lib/spree/api/responders/rabl_template.rb
spree_api-2.1.5 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.9 lib/spree/api/responders/rabl_template.rb
spree_api-1.3.5 lib/spree/api/responders/rabl_template.rb
spree_api-2.1.4 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.8 lib/spree/api/responders/rabl_template.rb
spree_api-2.1.3 lib/spree/api/responders/rabl_template.rb
spree_api-2.0.7 lib/spree/api/responders/rabl_template.rb
spree_api-2.1.2 lib/spree/api/responders/rabl_template.rb