I have an Application.rb that
belongs_to :company
and the Company.rb can
has_many :applications
I've set up friendly_id on the Company model but also want it on my application. But the Application doesn't store what I want as slug_candidates. I want slug candidates to be taken from the Company the application belongs to.
This is my Applicatio.rb
extend FriendlyId
friendly_id :slug_candidates, use: [:slugged, :history]
def slug_candidates
[
:intern_type,
[:intern_type, Company.city]
]
end
how would I set it up so it gets that it should take it from the Company?