Sha256: 6b541ae0e2057ebdfa5944d0b9f9a0d254dee8b91d75a42bfde64cf9a02d8af8

Contents?: true

Size: 286 Bytes

Versions: 9

Compression:

Stored size: 286 Bytes

Contents

module Restfulie::Server::ActionController::Trait::SavePriorToCreate
  def to_format
    if (options[:status] == 201) || (options[:status] == :created)==201
      if resource.save
        super
      else
        render :action => "new"
      end
    else
      super
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

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