Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Section < ActiveRecord::Base
- belongs_to :course
- has_many :quizzes, foreign_key: "lesson_id"
- has_many :lessons, foreign_key: "section_id"#, :inverse_of => :sections
- accepts_nested_attributes_for :lessons
- rails_admin do
- create do
- field :course do
- default_value do
- Course.last.id
- end
- end
- field :title
- end
- edit do
- field :course do
- default_value do
- Course.last.id
- end
- end
- field :title
- end
- end
- rails_admin do
- configure :lessons do
- field :title # This is the line that is giving the error
- field :body
- field :image
- end
- end
- end
- class Lesson < ActiveRecord::Base
- belongs_to :section #, foreign_key: "section_id"#, :inverse_of => :lessons
- has_many :posts, foreign_key: "lesson_id"
- has_one :quiz, :inverse_of => :lesson
- accepts_nested_attributes_for :quiz
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement