중첩 된 특성을 사용하여 레코드에 대해 여러 클립 클립 업로드를 추가하는 방법에 대한 자습서를 따라했지만 제대로 작동하는 것처럼 보였습니다. 이제는 기존의 모든 편집 할 수없는 문제가 있습니다. 기록하거나 새로운 것을 추가하십시오. 편집 양식을 통해 사진을 기존 레코드에 업로드 할 수 있습니다.레코드에 대한 여러 클립 클립 업로드가 새 기능 및 편집 기능을 중단합니다
새 레코드를 편집하거나 저장하면 앱이 리디렉션되지만 필드 내용은 저장되지 않으므로 새 레코드는 모든 필드를 nil로 저장하고 레코드를 편집 할 때 변경 사항을 저장하지 않습니다. 나는 attr_accessible을 제거하면
장소 모델
class Venue < ActiveRecord::Base
attr_accessible :venuephotos_attributes
belongs_to :area
belongs_to :venuetype
has_many :reviews
has_many :venuephotos
accepts_nested_attributes_for :venuephotos, :allow_destroy => true
scope :with_type, lambda { |types|
types.present? ? where(:venuetype_id => types) : scoped }
scope :with_area, lambda { |areas|
areas.present? ? where(:area_id => areas) : scoped }
def to_param
"#{id}-#{name.gsub(/\W/, '-').downcase}"
end
end
는 : venuephotos_attributes 새로운 편집 페이지가 다시 작동 라인.
도움 주셔서 감사합니다.