Open raphaelchpprt opened 4 years ago
Why
We will create a profile for employees so they can book massage slots.
How
In the migration file:
t.belongs_to :employee, index: true
In the model:
[x] validates :first_name, presence: true
validates :first_name, presence: true
[x] validates :last_name, presence: true
validates :last_name, presence: true
[x] belongs_to :employee
belongs_to :employee
[x] rails generate controller employees edit update
[x] implement an after_sign_up method in the file application_controller.rb
after_sign_up
application_controller.rb
[x] test EmployeeProfile.create in the console locally
EmployeeProfile.create
[x] Update seed.rb
seed.rb
Must Have
Reading List
Why
We will create a profile for employees so they can book massage slots.
How
In the migration file:
t.belongs_to :employee, index: true
In the model:
[x]
validates :first_name, presence: true
[x]
validates :last_name, presence: true
[x]
belongs_to :employee
[x] rails generate controller employees edit update
[x] implement an
after_sign_up
method in the fileapplication_controller.rb
[x] test
EmployeeProfile.create
in the console locally[x] Update
seed.rb
Must Have
Reading List