ActiveScaffold Rails 3 - Trying to Use Paperclip with Polymorphic Associations

181 views
Skip to first unread message

Mike

unread,
Aug 24, 2011, 1:06:18 PM8/24/11
to actives...@googlegroups.com
I'm not sure the best way to do this.  It doesn't appear as though the Polymorphic association is being detected by Active Scaffold?  When I add the model association to ActiveScaffold it gives a Template::Error (Could not find ImagesController or ImageController) 

For Example:

class Image < ActiveRecord::Base
  belongs_to :imageable, :polymorphic => true
  has_attached_file :image
end

class User < ActiveRecord::Base
  has_many :images, :as => :imageable
end

I don't know if the best way would be to set these up as some type of nested or embedded scaffold instead?
I'm not sure what step I might be missing here, but any help would be appreciated.
Thanks!
Mike

Sergio Cambra .:: entreCables S.L. ::.

unread,
Aug 25, 2011, 5:45:27 AM8/25/11
to actives...@googlegroups.com


Have you created ImagesController and configure it to use with ActiveScaffold?
ActiveScaffold needs a controller for each associated model, to get subform
columns info.

--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

Mike

unread,
Aug 25, 2011, 1:26:27 PM8/25/11
to actives...@googlegroups.com
darn it!  I was making that way harder than it was.  That's exactly what I needed to do. 
Thanks!
Reply all
Reply to author
Forward
0 new messages