В моем приложении rails у меня есть следующие модели
class Member < ActiveRecord::Base
has_many :trainings
end
class Student < ActiveRecord::Base
belongs_to :member
has_many :trainings #maybe a through relationship here
end
class Teacher < ActiveRecord::Base
belongs_to :member
end
######отредактировано#################
class Training < ActiveRecord::Base
belongs_to :member #only member not student nor teacher
end
#############################
Теперь, как я могу построить тренировки в моем студенческом контроллере
class StudentsController < ApplicationController
def new
@student = Student.new
@student.trainings.build #### This is not working
end
end
Спасибо
Training
модель? - person Jordan Allan   schedule 07.02.2015