Sha256: 74c86aab3926f948e34485a1ea11245c59b18acd7c0195050728a9be42e8b325

Contents?: true

Size: 440 Bytes

Versions: 1

Compression:

Stored size: 440 Bytes

Contents

module Restfulie
  module Server
    module ActionController
      
      # Adds support to answering as a 201 when the resource has been just created
      module CreatedResponder

        def to_format
          if (options[:status] == 201) || (options[:status] == :created)
            head :status => 201, :location => controller.url_for(resource)
          else
            super
          end
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
restfulie-0.9.3 lib/restfulie/server/action_controller/created_responder.rb