Module: ActiveScaffold::Bridges::Paperclip::PaperclipBridge

Defined in:
lib/active_scaffold/bridges/paperclip/paperclip_bridge.rb

Instance Method Summary collapse

Instance Method Details

#initialize(model_id) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/active_scaffold/bridges/paperclip/paperclip_bridge.rb', line 5

def initialize(model_id)
  super
  return unless model.respond_to?(:attachment_definitions) && !model.attachment_definitions.nil?

  update.multipart = true
  create.multipart = true

  model.attachment_definitions.each_key do |field|
    configure_paperclip_field(field.to_sym)
    # define the "delete" helper for use with active scaffold, unless it's already defined
    ActiveScaffold::Bridges::Paperclip::PaperclipBridgeHelpers.generate_delete_helper(model, field)
  end
end