Class: UserAccountsController
Instance Method Summary
collapse
#current_navable, #current_navable=, #current_user, #point_navigation_to, #redirect_www_subdomain, #set_locale
Instance Method Details
#create ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'app/controllers/user_accounts_controller.rb', line 28
def create
@user = User.find_by_id(params[:user_id])
@user_account = @user.build_account
respond_to do |format|
if @user_account.save
@user.send_welcome_email
format.html { redirect_to :back, notice: t(:user_account_created) }
format.json { render json: @user_account, status: :created, location: @user_account }
else
format.html { render action: "new" }
format.json { render json: @user_account.errors, status: :unprocessable_entity }
end
end
end
|
#destroy ⇒ Object
46
47
48
49
50
51
52
53
54
|
# File 'app/controllers/user_accounts_controller.rb', line 46
def destroy
@user_account = UserAccount.find(params[:id])
@user_account.destroy
respond_to do |format|
format.html { redirect_to :back, notice: t(:user_account_deleted) }
format.json { head :no_content }
end
end
|
#edit ⇒ Object
24
25
26
|
# File 'app/controllers/user_accounts_controller.rb', line 24
def edit
@user_account = UserAccount.find(params[:id])
end
|
#new ⇒ Object
15
16
17
18
19
20
21
22
|
# File 'app/controllers/user_accounts_controller.rb', line 15
def new
@user_account = UserAccount.new
respond_to do |format|
format.html format.json { render json: @user_account }
end
end
|
#show ⇒ Object
6
7
8
9
10
11
12
13
|
# File 'app/controllers/user_accounts_controller.rb', line 6
def show
@user_account = UserAccount.find(params[:id])
respond_to do |format|
format.html format.json { render json: @user_account }
end
end
|