module ApiVersions
  module SimplifyFormat
    extend ActiveSupport::Concern

    included do
      before_filter :simplify_format
    end

    private

    def simplify_format
      request.headers['Accept'] && request.headers['Accept'].match(/\+\s*(\w+)/) { |m| request.format = m[1] }
    end
  end
end

module ApiVersions
  module SimplifyFormat
    extend ActiveSupport::Concern

    included do
      prepend_before_filter :simplify_format
    end

    private

    def simplify_format
      request.headers['Accept'] && request.headers['Accept'].match(/\+\s*(\w+)/) { |m| request.format = m[1] }
    end
  end
end

Simplify format should be a prepend.
Simplify format should be a prepend.

This way if any other before_filters need the simplified format it
is available to them.
