Class: Admin::UsersController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/admin/users_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/admin/users_controller.rb', line 12

def create
  # protects against session fixation attacks, wreaks havoc with 
  # request forgery protection.
  # uncomment at your own risk
  # reset_session
  @user = User.new(params[:user])
  @user.save!
  self.current_user = @user
  redirect_back_or_default(admin_galleries_url)
  flash[:notice] = "Thanks for signing up!"
rescue ActiveRecord::RecordInvalid
  render :action => 'new'
end

#newObject

render new.rhtml



8
9
10
# File 'app/controllers/admin/users_controller.rb', line 8

def new
  @page_title = "Create user"
end