Sha256: 18e5f21c46cf123269cdb389fc3ae38f82075d012649de4d0ca004b651cd12c1

Contents?: true

Size: 422 Bytes

Versions: 1

Compression:

Stored size: 422 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 [201, :created].include? options[:status]
            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.1 lib/restfulie/server/action_controller/created_responder.rb