이 작은 문제를 해결하기 위해 마침내 내 다형성 연관이 작동하지만 이제 레코드가 저장되면보기에 이미지를 표시하는 방법을 파악할 수 없습니다.보기의 다형성 속성에 액세스
내 설치
class Image < ActiveRecord::Base
belongs_to :imageable, polymorphic: true
attr_accessible :photo
has_attached_file :photo, :styles => { :small_blog => "250x250#", :large_blog => "680x224#", :thumb => "95x95#" }
end
class Post < ActiveRecord::Base
has_many :images, as: :imageable
accepts_nested_attributes_for :images
attr_accessible :comments, :title, :images_attributes
end
그래서 내보기에 내가 모든 포인터가
죄송 많은 이미지를 가지고 있으며, 각각의 이미지는 사진, 아니 게시물이 있습니다 그래서 같이 갈 수 있습니다. –
어떻게 접근할까요? 어쩌면이게 왜 섞여있는거야? 모든 포인터를 주셔서 감사합니다. – Richlewis