0
我有它接受嵌套ATTRS其他几个型号模型的形式:的Rails 3:私人预览模型更改
class Page < ActiveRecord::Base
belongs_to :user
has_many :images
has_many :videos
has_many :options
accepts_nested_attributes_for :images
accepts_nested_attributes_for :videos
accepts_nested_attributes_for :options
def active?
published # boolean field
end
end
我想在网页所有者(用户)能够编辑页面和它的嵌套attrs,并立即看到这些变化,而不需要保存模型(这会使其公开可见)。我的直觉反应是克隆页面及其所有关联(yike!),以便原件保持不变,直到拥有者对克隆的更改感到满意为止。
是否有更合理或有效的解决方案?