Displaying 3 results from an estimated 3 matches for "listing_imag".
Did you mean:
listing_image
2006 May 30
1
Can''t read from file field second time around
...y it works for one iteration but then fails with:
zero-length blob not permitted `''
On the line:
img = Magick::Image.from_blob(self.image).first
I am basically doing this in the controller and it fails on the second
attempt - to resize and save the medium size image:
if @params[:listing_image]
@thumbnail_image = ListingImage.new(@params[:listing_image])
@listing = @session[:listing]
@thumbnail_image.listing_id = @listing.id
@thumbnail_image.image_type = "thumb"
@thumbnail_image.resize
if @thumbnail_image.save!
@med_im...
2006 May 07
4
Getting column value from lookup table in HABTM relationship
...ble I have a column called ''is_primary_agent''
which denotes if the agent is responsible for the listing - only one
agent can be primary.
At the moment I use this in my listing_controller''s view action:
@listing = Listing.find(@params[:id], :include => [ :agents,
:listing_images, :listing_pdfs ] )
What is the best, most efficient way to have this attribute appear
against my agents?
TIA,
Matt.
2006 May 18
0
file_column - filtering uploaded file type and storing image size?
Sorry, more newby FC questions!
I would like to use one file upload field to upload both PDFs and images.
The images are in the listing_images table and PDFs are in the
listing_pdfs table - both have a one-to-many relationship with listings.
How do I do this?
For listing_images, I would like to store the width and height of the
image so I can produce valid xhtml image tags. I can''t see anything in
the file_column docs (I am...