Class: Aikotoba::AccountsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/aikotoba/accounts_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#aikotoba_controller?

Methods included from EnabledFeatureCheckable

#confirmable?, #lockable?, #recoverable?, #registerable?

Instance Method Details

#createObject



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 = (accounts_params.to_h.symbolize_keys)
  ActiveRecord::Base.transaction do
    
    save_with_callbacks!(@account)
    
  end
  redirect_to , flash: {notice: successed_message}
rescue ActiveRecord::RecordInvalid => e
  (e)
  flash[:alert] = failed_message
  render :new, status: :unprocessable_entity
end

#newObject



5
6
7
# File 'app/controllers/aikotoba/accounts_controller.rb', line 5

def new
  @account = ({email: "", password: ""})
end