【发布时间】:2019-05-15 20:29:15
【问题描述】:
这是我显示用户的显示操作
def show
manager = HiringManager.find(params[:id])
candidates = manager.users.to_json(:include => [:experiences, :educations])
render :json => { manager: manager, candidates: candidates }
end
还有我的 HiringManager 和 Hire Models
class HiringManager < ActiveRecord::Base
has_many :hires
has_many :users, through: :hires
end
class Hire < ApplicationRecord
belongs_to :hiring_manager
belongs_to :user
end
【问题讨论】:
标签: ruby-on-rails json activerecord