RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: polosilva
Was having problems Updating the widgets when saving a lecture through update_attributes(...). It was a matter of accessibility of the attributtes of widget.
class Lecture < ActiveRecord::Base attr_accessible :name , :order , :html, :widgets_attributes has_many :widgets accepts_nested_attributes_for :widgets, :allow_destroy => true end
class Widget < ActiveRecord::Base belongs_to :lecture attr_accessible :width, :height, :xpos, :ypos, :source end
The last line of the widget class made all the difference.
Was having problems Updating the widgets when saving a lecture through update_attributes(...). It was a matter of accessibility of the attributtes of widget.
The last line of the widget class made all the difference.