Image Display Question


#1

Hello there,

I have something odd happening to my image tags when displaying an
image.
Here’s what my ‘’ tags are looking like:

2-thumb

Notice the question mark at the end of the string. I have no idea where
this
coming from. Here are the important parts of my code:

In the ‘image’ model:

DIRECTORY = ‘public/uploaded_images’
def to_url
return DIRECTORY + “/#{self.id}-thumb.jpg”
end

In the images_controller:

def list
@images = Image.find :all, :order=>“id DESC”
end

In the list.rhtml view:

<%= render :partial=>'images', :collection=> @images %>

…and in the partial:
<%= image_tag(images.to_url) %>

It’s nothing fancy, but it’s driving me nuts trying to figure out where
that
darn question mark is coming from.

Any ideas on this?

Thank you!
Dave hoefler


#2

2006/4/20, Dave H. removed_email_address@domain.invalid:

I have something odd happening to my image tags when
displaying an image. Here’s what my ‘’ tags
are looking like:

2-thumb

Notice the question mark at the end of the string. I have no idea
where this
coming from. Here are the important parts of my code:

I think it comes from that :

(extract of actionpack CHANGELOG)

  • Added automated timestamping to AssetTagHelper methods for
    stylesheets, javascripts, and images when Action Controller is run
    under Rails [DHH]. Example:

    image_tag(“rails.png”) # => ‘Rails

    …to avoid frequent stats (not a problem for most people), you can
    set RAILS_ASSET_ID in the ENV to avoid stats:

    ENV[“RAILS_ASSET_ID”] = “2345”
    image_tag(“rails.png”) # => ‘Rails

    This can be used by deployment managers to set the asset id by
    application revision

    РJean-Fran̤ois.


#3

Thanks Jean. That clears it up. :wink:

-Dave