Module: Restfulie::Server::ActionController::Trait::Created

Included in:
RestfulResponder
Defined in:
lib/restfulie/server/action_controller/trait/created.rb

Overview

Adds support to answering as a 201 when the resource has been just created

Instance Method Summary collapse

Instance Method Details

#to_formatObject



7
8
9
10
11
12
13
# File 'lib/restfulie/server/action_controller/trait/created.rb', line 7

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