Why ?
Masseurs have to be able to indicate their category/categories of massages, their time slots and the places they can work.
How ?
[x] add attributes to the masseur_profile model. Add these following attributes as arrays : massage_types, time_slots, working_places. The example on how to do this is in the first element of the reading list.
[x] edit the 3 previous attributes to make them empty at the creation of a masseur_profile.
An example on how to set an empty attribute by default is :
add_column :time_slots_array, :array, :default => []
[x] Add constant arrays in the masseur_profile Model : massage_types, time_slots, working_places
[x] test in console the creation of a MasseurProfile. Edit it to see if the fileds are working properly.
[x] edit the seed to have MasseurProfile created with the new implemented attributes.
[x] edit the view with the checkboxes
[x] edit the controller to retrieve the params in the update method
Must have
[x] A MasseurProfile with the 3 new attributes working, and empty at the creation.
Why ? Masseurs have to be able to indicate their category/categories of massages, their time slots and the places they can work.
How ?
[x] add attributes to the masseur_profile model. Add these following attributes as arrays :
massage_types
,time_slots
,working_places
. The example on how to do this is in the first element of the reading list.[x] edit the 3 previous attributes to make them empty at the creation of a masseur_profile. An example on how to set an empty attribute by default is :
add_column :time_slots_array, :array, :default => []
[x] Add constant arrays in the masseur_profile Model :
massage_types
,time_slots
,working_places
[x] test in console the creation of a MasseurProfile. Edit it to see if the fileds are working properly.
[x] edit the seed to have MasseurProfile created with the new implemented attributes.
[x] edit the view with the checkboxes
[x] edit the controller to retrieve the params in the update method
Must have
Reading list
add migration to add arrays : https://stackoverflow.com/questions/20937792/rails-adding-migration-to-add-an-array-default-empty
https://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/collection_select