Class: Aspartame::AspartameUsersController
Instance Method Summary
collapse
#aspartame_current_user, #aspartame_current_user=, #aspartame_current_user?, #aspartame_redirect_back_or, #aspartame_sign_in, #aspartame_sign_out, #aspartame_signed_in?, #aspartame_signed_in_user, #aspartame_store_location
Instance Method Details
#create ⇒ Object
20
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/aspartame/aspartame_users_controller.rb', line 20
def create
@aspartame_user = Aspartame::AspartameUser.new(params[:aspartame_user])
if @aspartame_user.save
aspartame_sign_in @aspartame_user
redirect_to aspartame.aspartame_users_path
else
render 'new'
end
end
|
#destroy ⇒ Object
31
32
33
34
35
|
# File 'app/controllers/aspartame/aspartame_users_controller.rb', line 31
def destroy
Aspartame::AspartameUser.find(params[:id]).destroy
flash[:success] = "AspartameUser destroyed."
redirect_to aspartame_users_path
end
|
#edit ⇒ Object
37
38
39
|
# File 'app/controllers/aspartame/aspartame_users_controller.rb', line 37
def edit
@aspartame_user = Aspartame::AspartameUser.find(params[:id])
end
|
#index ⇒ Object
56
57
58
|
# File 'app/controllers/aspartame/aspartame_users_controller.rb', line 56
def index
@aspartame_users = Aspartame::AspartameUser.paginate(page: params[:page])
end
|
#new ⇒ Object
16
17
18
|
# File 'app/controllers/aspartame/aspartame_users_controller.rb', line 16
def new
@aspartame_user = Aspartame::AspartameUser.new
end
|
#show ⇒ Object
12
13
14
|
# File 'app/controllers/aspartame/aspartame_users_controller.rb', line 12
def show
@aspartame_user = Aspartame::AspartameUser.find(params[:id])
end
|
#update ⇒ Object
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'app/controllers/aspartame/aspartame_users_controller.rb', line 41
def update
@aspartame_user = Aspartame::AspartameUser.find(params[:id])
if @aspartame_user.update_attributes(params[:aspartame_user])
respond_to do |format|
format.html { flash[:success] = "Profile successfully updated!"
redirect_to aspartame.edit_aspartame_user_path(@aspartame_user)
}
format.js
end
else
render 'edit'
end
end
|