adorable-france-99527
07/31/2023, 4:35 PMadorable-france-99527
07/31/2023, 4:36 PMuser belongs_to :company
can the resource display user.company.name
or do I need to define a def company_name
on the user itself?lemon-wall-20836
07/31/2023, 5:44 PMruby
field :company_name, as: :text do
record.company.name
end
# don't forget to eager load the company
self.includes = [:company]
lemon-wall-20836
07/31/2023, 5:49 PMIndex
and Show
viewsadorable-france-99527
07/31/2023, 7:09 PM