search for: attachment_options

Displaying 8 results from an estimated 8 matches for "attachment_options".

2009 Jul 24
1
Attachment_fu - watermark tmp file before saved to S3
Hi there, I''d like to use RMagick to watermark an image in the tmp directory before Attachment_fu saves it to Amazon S3. I took a look at the callbacks available in attachment_fu. There''s an ''after_attachment_saved'' method but this would be too late, and a ''before_thumbnail_saved'' but this is no good because it''s for thumbnails. I
2007 Apr 27
3
attachment_fu content_type problem
Hi all.... Admittedly I''m new to Rails and trying to find my way but I''m having an issue with uploading documents with attachment_fu. I have a form where I''m uploading multiple attachments (using AJAX to add file_filed_tags). That seems to work pretty well. The problem is I can''t seem to get the content_type to work as I would expect. For example, if I use
2007 Mar 04
3
Dynamically setting the image directory used by attachment_fu
...iated to the thumbnail child before_thumbnail_saved do |record, thumbnail| thumbnail.item = record.item end def full_filename(thumbnail = nil) # Just to be sure the ID gets set raise "Missing Item ID" if item_id.nil? file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix].to_s File.join(RAILS_ROOT, file_system_path, item_id.to_s, attachment_path_id, thumbnail_name_for(thumbnail)) end and in your Item class you add a condition since it makes it easier to iterate over the images and for example call the image helpers has_many :item_images, :con...
2007 Aug 22
8
How to spec an attachment_fu model
First off, I''m not trying to spec attachment_fu, I know it''s been tested. But, I added some code to that model that I do need to test. Basically, I need to somehow fulfill the "uploaded_data" property so I can actually run my tests(otherwise they fail because of validations). The "uploaded_data" field is what would grab the multipart data from form. Here
2007 Aug 18
0
RSpec and acts_as_attachment
...s_attachment/lib/technoweenie/acts_as_attachment/ instance_methods.rb:152 :in `attachment_attributes_valid?'' ./spec/models/../spec_helper.rb:635 :in `create_user_file'' ./spec/models/user_file_spec.rb:11 152 [:size, :content_type].each do |attr_name| 153 enum = attachment_options[attr_name] 154 errors.add attr_name, ActiveRecord::Errors.default_error_messages[:inclusion] unless enum.nil? || enum.include?(send(attr_name)) 155 end 156 end --- David Rice http://www.davidjrice.co.uk -------------- next part -------------- An HTML attachment w...
2008 May 28
1
Attachment_fu, polymorphism and customization
Hi, I got Image model that has_attachment and belongs_to 2 other models via polymorphic association. The problem is that I''d like to customize has_attachment options (resize image) depending on which model the Image is related to - i.e. if Image belongs to Article it should be resized using different settings than if it belongs to Header. Is there a smart way to do it or do I have to
2010 Jul 11
0
Attachement_fu error when updating existing photos
...filesystem path # RAILS_ROOT/public/my_models/5/blah.jpg # # Overwrite this method in your model to customize the filename. # The optional thumbnail argument will output the thumbnail''s filename. def full_filename(thumbnail = nil) file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix].to_s File.join(RAILS_ROOT, file_system_path, *partitioned_path(thumbnail_name_for(thumbnail))) end Anybody have an idea what I am doing wrong? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Ra...
2007 Dec 13
4
Attachment_fu problems on updates
...bers has_one :photo, :as => "photo_for" validates_associated :photo end Here is the file_system_backend (where the error is occurring): ----------------------------------------------- def full_filename(thumbnail = nil) file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix].to_s #here is the join that is failing #logger.info "rails root:" + RAILS_ROOT => /Users/... #logger.info "file sys path" + file_system_path => public/photos #logger.info thumbnail => nothing show up here File.join(RAILS_ROOT, fil...