Extending Active Scaffold as_paperclip_bridge to delete & update image/attachment
As you know I’m quite fond of working with Active Scaffold (AS) for data administration proposes. Quite recently we moved over to the RoR paperclip attachment plugin for file upload handling. I was even more happy to see a Active Scaffold bridge which integrates paperclip smoothly into AS as well. It’s created by and hosted here on github.
Unfortunately it didn’t provide the possibility to delete or update an image once it’s assigned to an object. Well no problem, another fork of mine, some coding and now it possible. I basically reused to code of the as_file_column_bridge. Check it out here:
http://github.com/rngtng/as_paperclip_bridge/tree/master
Update: changes got merged into trunk, check it out:
Thanks for the enhancement.
Can you add how to get thumbnal image in AS list template instead of file link?
I figured out that if you have :thumbnail in model:
has_attached_file :flag, :styles => { :medium => “198×280>”, :thumbnail => “119×168>” }
you have the image instead of link.
It probably comes from line 25 in as_papeclip_bridge.rb
self.columns[field].list_ui ||= self.model.attachment_definitions[field][:styles].include?(:thumbnail) ? :paperclip_thumb : :paperclip_link
Link to your fixed as_paperclip_bridge,
http://github.com/rngtng/as_paperclip_bridge/tree/master
is broken.
jet
true, thx, my changes got merged into main repository trunk, please check out instead:
http://github.com/mnaglik/as_paperclip_bridge/