我有 2 个模型,活动和城市
class activity
has_many :attachments, :as => :attachable
accepts_nested_attributes_for :attachments
belongs_to city
end
class city
has_many :activties
end
city_controller
@activity_deals = @city.activities.find_all_by_deals(true)
end
查看城市
- @activity_deals.attachments.each do |a|
= image_tag(a.file.url, :height =>"325px", :width =>"650px" )
= a.description
我收到错误undefined method
附件'`