Class: Frontend::UsersController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/frontend/users_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/frontend/users_controller.rb', line 5

def create
	# Be careful: Make sure it is ::User, not 'User'
	# Might get confused with Frontend::User!
	@user = ::User.new(params[:user])
	# +_+ #
	respond_to do |format|
		if @user.save
			format.xml do
 			render :xml => @user, :status => :created, :location => [:frontend, @user]
			end
		else
			format.xml do
				render :xml => @user.errors, :status => :unprocessable_entity
			end
		end
	end
end