私はこれが問題である
レール:親の親の親から範囲
School
has_many :students
has_many :accounts, :through => :students
Student
belongs_to :school
has_one :account
Account
belongs_to :student
以下の関係を持って、私は学校
のカップルを持っていると私はアカウントを取得したいがして、特定の学校に所属ページ区切り
これをロードするにはどうすればよいですか?
@accounts = Accounts.where(...).page(params[:page]).per(10)
私は
School
has_many :classrooms
Classroom
belongs_to :school
has_many :students
has_many :accounts, :through => :students
Student
belongs_to :classroom
has_one :account
Account
belongs_to :student
と質問以下の関係を持っている私の質問
を逃した私は、あなたができるようにすべきだと思う:)
あなたの質問へのアップデートに合わせて私の回答を更新しました – oreoluwa