Displaying 6 results from an estimated 6 matches for "thumbnail_name_for".
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 Mar 04
3
Dynamically setting the image directory used by attachment_fu
...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,
:conditions => "parent_id is null"
Now all the directories will be grouped by the item_id.
Eric
--~--~-...
2007 Jun 27
5
How to make attachment_fu generate RESTFUL URL
hi folks:
I follow this article:http://clarkware.com/cgi/blosxom/2007/02/24
all goes well except the public_filename ,it return something like
"photos/0000/0001/test.jpg" ,not the expected RESTFUL URL LIKE
''photos/1/test.jpg'',any suggestion?
My Env is Rails 1.2.3 on Ruby 1.8.6 with attachment_fu from http
://svn.techno-weenie.net/projects/plugins/attachment_fu/ by now
2010 Jul 11
0
Attachement_fu error when updating existing photos
...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 Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF...
2007 Sep 18
2
Making attachment_fu polymorphic
I am working on a small model mixin called attachment_kung to make
attachment_fu polymorphic, so you no longer need a different table and
Model class for every associated attachment (Productimage, Ad_doc,
etc). All you really need is one model and table to handel all your
attachments - in some cases, anyway. I have the code working, but have
run into one small hitch that I can''t seem to
2007 Dec 13
4
Attachment_fu problems on updates
...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, file_system_path,
*partitioned_path(thumbnail_name_for(thumbnail)))
end
The photo model is polymorphic which is why it exists as a separate
model.
I have never had this problem before, but this is the first polymorphic
relation that I have used to link to the uploaded images.
Thanks for the help.
--
Posted via http://www.ruby-forum.com/.
--~--~---...