Updating on later pages of registration process

This commit is contained in:
Rob H
2014-08-21 17:04:40 +10:00
parent 60d6599f9b
commit f1f9a2e7fc
5 changed files with 58 additions and 26 deletions

View File

@@ -17,7 +17,18 @@ module Api
@enterprise = Enterprise.new(params[:enterprise])
if @enterprise.save
render text: '', :status => 201
render text: @enterprise.id, :status => 201
else
invalid_resource!(@enterprise)
end
end
def update
authorize! :update, Enterprise
@enterprise = Enterprise.find(params[:id])
if @enterprise.update_attributes(params[:enterprise])
render text: @enterprise.id, :status => 200
else
invalid_resource!(@enterprise)
end