Skip to content

Commit

Permalink
save prior to create a resource
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesilveira committed Oct 30, 2010
1 parent 99ff72f commit 1459a72
Showing 1 changed file with 13 additions and 0 deletions.
@@ -0,0 +1,13 @@
module Restfulie::Server::ActionController::Trait::SavePriorToCreate
def to_format
if controller.response.code==201
if resource.save
super
else
render :action => "new"
end
else
super
end
end
end

0 comments on commit 1459a72

Please sign in to comment.