Class: BlueLightSpecial::UsersController

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

Instance Method Summary collapse

Instance Method Details

#createObject



18
19
20
21
22
23
24
25
26
# File 'app/controllers/blue_light_special/users_controller.rb', line 18

def create
  @user = ::User.new params[:user]
  if @user.save
    (@user)
    redirect_to(url_after_create)
  else
    render :template => 'users/new'
  end
end

#editObject



28
29
30
31
# File 'app/controllers/blue_light_special/users_controller.rb', line 28

def edit
  @user = current_user
  render :template => 'users/edit'
end

#newObject



13
14
15
16
# File 'app/controllers/blue_light_special/users_controller.rb', line 13

def new
  @user = ::User.new(params[:user])
  render :template => 'users/new'
end

#showObject



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

def show
  @user = current_user
  render :template => 'users/show'
end

#updateObject



33
34
35
36
37
38
39
40
41
# File 'app/controllers/blue_light_special/users_controller.rb', line 33

def update
  @user = current_user
  if @user.update_attributes(params[:user])
    flash[:success] = 'Your profile has been updated.'
    redirect_to user_path(@user)
  else
    render :template => 'users/edit'
  end
end