Im confuse with has_many through models in rails 4, I have 3 models
profile:
has_many :profile_services
has_many :services, through: :profile_services
service:
has_many :profile_services
has_many :profiles, through: :profile_services
profile_service:
belongs_to :profile
belongs_to :service
so in my service model have name and description, and in my profile_service have price because I need when the user create the profile automatically have 3 services and he just can give a price for your services
And this logic is complicated for me because I think I don't need service controller because I will create this info with a seed just need create a controller for profile_service because the user add a price for these services but I don't know how to create these 3 services automatically when create the profile...
any suggestions? just to clear my mind
thanks for your time !
You may use ActiveRecord callbacks to perform any required initialization operations in your models.