Class: Aikotoba::AccountsController
Instance Method Summary
collapse
#aikotoba_controller?
#confirmable?, #lockable?, #recoverable?, #registerable?
Instance Method Details
#create ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/aikotoba/accounts_controller.rb', line 9
def create
@account = build_account(accounts_params.to_h.symbolize_keys)
ActiveRecord::Base.transaction do
before_create_account_process
save_with_callbacks!(@account)
after_create_account_process
end
redirect_to after_sign_up_path, flash: {notice: successed_message}
rescue ActiveRecord::RecordInvalid => e
failed_create_account_process(e)
flash[:alert] = failed_message
render :new, status: :unprocessable_entity
end
|
#new ⇒ Object
5
6
7
|
# File 'app/controllers/aikotoba/accounts_controller.rb', line 5
def new
@account = build_account({email: "", password: ""})
end
|