Sha256: 24387012bb2c9e352a9329fe6a08a4bf3f774bd33da7b6664bf4bb8539df5a41

Contents?: true

Size: 413 Bytes

Versions: 10

Compression:

Stored size: 413 Bytes

Contents

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

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

    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
restfulie-nosqlite-1.0.4 lib/restfulie/server/action_controller/trait/created.rb
restfulie-1.1.1 lib/restfulie/server/action_controller/trait/created.rb
restfulie-1.1.0 lib/restfulie/server/action_controller/trait/created.rb
restfulie-nosqlite-1.0.3 lib/restfulie/server/action_controller/trait/created.rb
restfulie-1.0.3 lib/restfulie/server/action_controller/trait/created.rb
restfulie-1.0.0 lib/restfulie/server/action_controller/trait/created.rb
restfulie-1.0.0.beta5 lib/restfulie/server/action_controller/trait/created.rb
restfulie-1.0.0.beta4 lib/restfulie/server/action_controller/trait/created.rb
restfulie-1.0.0.beta1 lib/restfulie/server/action_controller/trait/created.rb
restfulie-0.1.0.beta1 lib/restfulie/server/action_controller/trait/created.rb