Permalink
Browse files

some fixes

  • Loading branch information...
1 parent 2c3cef0 commit d90f606ce3dc9be0aea4490354a230c882169043 @amoslanka amoslanka committed Jul 21, 2011
View
@@ -1,4 +1,3 @@
= ActiveAdmin_Paperclip
Provides a set of helpers and builders to more quickly build out ActiveAdmin related panels and forms specifically related to Paperclip images.
-
@@ -23,8 +23,9 @@ def build(resource, attachment_name, attributes={})
add_class "paperclip"
super title, attributes
- attachment = (@resource.respond_to? @attachment_name.to_sym) ? @resource.send(@attachment_name.to_sym) : nil
- image_table_for attachment, attributes
+ # attachment = (@resource.respond_to? @attachment_name.to_sym) ? @resource.send(@attachment_name.to_sym) : nil
+ # image_table_for attachment, attributes
+ image_table_for @resource, @attachment_name, attributes
end
end
@@ -6,6 +6,9 @@ class ImageTableFor < AttributesTable
def build(record, attachment_name, *styles)
raise "Record cannot be nil." if record.nil?
+
+ # puts "Record: #{record}, Attachment_Name: #{attachment_name}"
+
@attachment = attachment = (record.respond_to? attachment_name.to_sym) ? record.send(attachment_name.to_sym) : nil
@style_list = !@attachment.nil? ? @attachment.styles.collect do |style| style.first end : []

0 comments on commit d90f606

Please sign in to comment.