Class: Aikotoba::AccountsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Aikotoba::AccountsController
- Defined in:
- app/controllers/aikotoba/accounts_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Methods included from Scopable
#aikotoba_scope, #aikotoba_scope_config, #aikotoba_scoped_path
Methods included from EnabledFeatureCheckable
#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: } rescue ActiveRecord::RecordInvalid => e failed_create_account_process(e) flash[:alert] = 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 |