Skip to content

Extending Active Scaffold as_paperclip_bridge to delete & update image/attachment

2009 August 13

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:

Update: changes got merged into trunk, check it out:

4 Responses
  1. tobi permalink*
    January 11, 2010

    true, thx, my changes got merged into main repository trunk, please check out instead:

  2. jet permalink
    January 10, 2010

    Link to your fixed as_paperclip_bridge,

    is broken.


  3. xxx permalink
    August 22, 2009

    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

  4. xxx permalink
    August 22, 2009

    Thanks for the enhancement.
    Can you add how to get thumbnal image in AS list template instead of file link?

Comments are closed.