search for: has_attachment

Displaying 20 results from an estimated 32 matches for "has_attachment".

2007 Sep 25
2
attachment_fu default path
Hi all. I''ve done a little google search, but doesn''t find anything (with "attachment_fu default path") that could help me in changing attachment_fu''s default path. My model: [audio.rb] has_attachment :max_size => 20.megabytes has_attachment :content_type => "audio/mpeg" has_attachment :storage => :file_system has_attachment :path_prefix => "public/files [/audio.rb] But all my files go on been uploaded to public/files/0000/00[last inserted id]/my_fil...
2009 Mar 06
1
attachment_fu has_attachment model logic reasoning?
Both Attachment_fu and Paperclip use something like ''has_attachment'' to work their magic on an existing model like a User in the context of a profile picture or something like that. I find this idea pretty constricting, as it doesn''t allow for multiple profile pictures for example. Or at least I wouldnt know how to set this up with either of the...
2008 Jun 19
0
undefined method `has_attachment'
Any ideas what could cause this error: undefined method `has_attachment'' The server has been restarted. I''ve used this plugin before (and from the exact same repo) and haven''t had this problem before. I''ve searched google and it seems most people that encounter the error just didn''t restart their server. --~--~---------~--~...
2007 Apr 27
3
attachment_fu content_type problem
...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 this: has_attachment :content_type => [''application/pdf'', ''application/ msword'', ''text/plain''] I would expect I can upload .pdf, .doc and .txt files but I get and Document is invalid error (document is the name of my model) I have played around with different c...
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...
2009 Apr 21
3
attachment_fu giving problem on production
Hello friends, I have configured attachment_f. It''s working fine on Local(development) system but giving problem on production. Basically on production the attachment_fu is not able to generate thumbnail image it saving the original size image. Below is the configuration. has_attachment :content_type => :image, :storage => :file_system, :max_size => 500.kilobytes, :thumbnails => {:thumb => ''170x60>''}, :processor => ''Rmagick'', :path_prefix =&...
2007 Sep 18
2
Making attachment_fu polymorphic
...t and attachments), ## set them up for polymorphism. Add to the table a column called path_prefix. ## (I used: belongs_to :attachable, :polymorphic => true for the model and attachable_type and ## attachable_id for the table); and configure the Attachment_fu model with ## has_attachment :storage => :file_system ## include Attachment_kung ## Make sure Attachment_kung is *last*, or you will not be able to display your attachments. Also, ## I have not tested Attachment_kung with :storage => :s3 or :storage => :db_system. I *ought* to ## work, but one...
2007 May 07
1
attachment_fu seems to be searching the wrong location for my images
I just installed attachment_fu and for some reason, it seems to be looking in the wrong location for my images. I have a Product model that belongs to a photo model. the photo model has the attachment_fu installed and configured like so: class Photo < ActiveRecord::Base has_attachment :content_type => :image, #Allow standard image formats :path_prefix => ''public/photos'', #Where to store the uploaded images (shouldn''t need this) :storage => :file_system, #Store files in...
2007 Apr 17
1
attachment_fu - propagating attributes to thumbnails
I have a model using attachment_fu (via has_attachment) and I''m creating thumbnails for the attached images. I have an extra field ''foo'' that I''m validating on create with validates_presence_of :foo. One problem arises when I upload an image: The ''foo'' is not propogating down to the thumbnails....
2008 May 16
3
has_one and find_by_id issue
I have two models: testamonial photo (has_attachement) testamonial has_one photo The issue is when do this: @testamonial = Testamonial.find_all_by_id(id) I get "undefined method `photo'' for" in my browser?? BUT here is the big kicker.... If I do @testamonial = Testamonial.find(:first) everything works fine and the image is show!.. (find :all works too when I loop
2007 Apr 21
3
attachment_fu thumbnails
...else worked. I read this post http://www.ruby-forum.com/topic/104213 and added a parent_id column. now I get the following error when I trie to add a photo: undefined method `find_or_initialize_by_thumbnail_and_parent_id'' for Photo:Class my code is: class Photo < ActiveRecord::Base has_attachment :content_type => :image, :storage => :file_system, :max_size => 1.megabyte, :thumbnails => { :thumb => ''164x164>'' } end create_table :photos do |t| t.column :filename, :string t.column :posted_on, :datetime t.co...
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
2010 Apr 24
2
problem using attachment_fu with S3
...::RequestTimeout in Upload filesController#create Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed. hope someone can help out or pint me to an application that works. i have attached my db file. in my model I have has_attachment :content_type => :image, :storage => :s3, :size => 0.megabyte..3.megabytes, :resize_to => ''450x450>'', :thumbnails => { :thumb => ''150x150>'' } validates_as_attachment my view new <h1>New upload_file</h1> <%= error_messages_f...
2007 Mar 28
3
attachment_fu Not Resizing
Hello, Recently attachment_fu stopped resizing images for me. I''m puzzled because before today it was resizing them and I don''t know what''s changed. Here''s my code: class Product < ActiveRecord::Base has_attachment :content_type => :image, :storage => :file_system, :max_size => 18.megabytes, :resize_to => ''300x'', :thumbnails => { :thumb => ''61x110!'' } validates_as_atta...
2007 Apr 08
13
attachment_fu thumbnail not created
I followed the instructions on Mike Clark''s weblog and everything works perfectly except the thumbnail column in my DB is alwas NULL. I''m using S3 as my storage system. Anyone else having this issue with thumbnails? has_attachment :content_type => :image, :storage => :s3, :max_size => 500.kilobytes, :resize_to => ''150x150>'', :thumbnails => { :thumb => ''40x40>'' }, :processor => ...
2008 Jun 09
10
Testing file attachment with Paperclip
Does someone have an example on faking a file upload for just ensuring it gets called, without actually uploading the file to s3. I thought that stubbing Model.has_attached_file would be enough, but it doesn''t seem so ... This is what I did: Video.stub!( :has_attached_file ).with( :name ).and_return( true ) has_attached_file is from paperclip, it gets mixed to the model. 1)
2006 Jun 28
0
Reading email attachments
...email.delete rescue Exception => e logger.error "Error receiving email at " + Time.now.to_s + "::: " + e.message end end end end And then this in MailReader (after it has been converted to a Tmail object) if mail.has_attachments? for email_attachment in mail.attachments RAILS_DEFAULT_LOGGER.info ''creating attachment'' attachment = Attachment.new attachment.uploaded_file( email_attachment, attachment ) c.attachments << attachment if attachment.save...
2007 Aug 21
0
plugins loaded after the models?
Hi, I was trying to port attachment_fu to Merb and I realized that adding has_attachment( :content_type => :image, [...] ) in a model would break the app. I realized (let me know if I''m wrong) that the plugins are loaded after the models. Because of that I now have to load my plugin from my model to be able to use it directly. Did I miss something or is there a spec...
2007 Nov 09
0
Problem with Actionmailer/TMail & decoding Apple Mail Attachments
...ments that are sent from it. I''m not 100% sure but I think it might have something to do with them being inline. I''m a bit stumped, I haven''t managed to find anything about this anywhere and just wondered if anyone had come up again this? def receive(email)... if email.has_attachments? email.attachments.each do |attachment|... the array of attachments is valid but is empty. This and looking at what gets chucked at the method is what lead me to believe that inline might be the problem. Any ideas? T --~--~---------~--~----~------------~-------~--~----~ You receive...
2007 Dec 02
0
attachment_fu doesn't generate thumbnails on windows
...Windows" thread http://www.ruby-forum.com/topic/99870?reply_to=553924 The result is I can upload the original image ok but still no thumbnails are generated and the only row in my mugshots table is for the original image. My Mugshot class looks like class Mugshot < ActiveRecord::Base has_attachment :content_type => :image, :storage => :file_system, :processor => ''Rmagick'', :max_size => 6.megabytes, :resize_to => ''100x100>'', :thumbnails => { :thumb =>...