Displaying 2 results from an estimated 2 matches for "item_images".
Did you mean:
item_image
2007 Mar 04
3
Dynamically setting the image directory used by attachment_fu
...mg_1.jpg
item_image/1/img_1_thumb.jpg
item_image/2/img_2.jpg
item_image/2/img_2_thumb.jpg
item_image/3/img_3.jpg
item_image/3/img_3_thumb.jpg
After a while you end up with ton of directories under the item_image
directory. Instead I wanted the images to be grouped by the item
object which has_many item_images. You can do that by adding the
following two methods to the item_image object.
# Make sure the related item is associated 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...
2006 Nov 08
0
Problem ith file_column
...file system and stores the file name in a database table
is awsome. But while I try to get the image by passing its ID,
surprisingly it returns the full absolute path rather than the image
name! I would like to give a littel more description about the problem.
There are two tables:- 1) items and 2)item_images
In the first table only item name and description is stored while in
the second table; the image name is stored along with the item_id from
the first table. I am using the following code to access the image from
database
itm = ItemImage.find_by_item_id(id).image # image is the column for
image n...