summaryrefslogtreecommitdiff
path: root/users/app
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-11-26 11:54:11 +0100
committerAzul <azul@leap.se>2012-11-26 11:54:11 +0100
commit595518684b9c4364f96c97a84cc481b5ae0da981 (patch)
treeee5aafd33cf90f4c2d099d364f6da1d6f7331024 /users/app
parentce0999ead0d61db1f6534ee9d8114c4551542e80 (diff)
simplified controller and adjusted tests
Also added #assert_json_error to tests.
Diffstat (limited to 'users/app')
-rw-r--r--users/app/controllers/users_controller.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb
index 3913d0d..5be1fa9 100644
--- a/users/app/controllers/users_controller.rb
+++ b/users/app/controllers/users_controller.rb
@@ -11,11 +11,8 @@ class UsersController < ApplicationController
end
def create
- @user = User.create!(params[:user])
- respond_with(@user, :location => root_url, :notice => "Signed up!")
- rescue VALIDATION_FAILED => e
- @user = e.document
- respond_with(@user, :location => new_user_path)
+ @user = User.create(params[:user])
+ respond_with @user
end
def edit
@@ -23,7 +20,7 @@ class UsersController < ApplicationController
def update
@user.update_attributes(params[:user])
- respond_with(@user, :location => edit_user_path(@user))
+ respond_with @user
end
protected