Hello there, I have something odd happening to my image tags when displaying an image. Here''s what my ''<img src>'' tags are looking like: <img alt="2-thumb" src="/images/public/uploaded_images/2-thumb.jpg?" /> 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: <div id="photos"> <%= render :partial=>''images'', :collection=> @images %> </div> ...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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/db6721bc/attachment.html
2006/4/20, Dave Hoefler <dhoefler@gmail.com>:> I have something odd happening to my image tags when > displaying an image. Here''s what my ''<img src>'' tags > are looking like: > > <img alt="2-thumb" src="/images/public/uploaded_images/2- > thumb.jpg?" /> > > 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") # => ''<img alt="Rails" src="/images/rails.png?1143664135" />'' ...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") # => ''<img alt="Rails" src="/images/rails.png?2345" />'' This can be used by deployment managers to set the asset id by application revision -- Jean-Fran?ois. -- ? la renverse.
Thanks Jean. That clears it up. ;-) -Dave On 4/20/06, Jean-Fran?ois <jf.web3@gmail.com> wrote:> > 2006/4/20, Dave Hoefler <dhoefler@gmail.com>: > > > I have something odd happening to my image tags when > > displaying an image. Here''s what my ''<img src>'' tags > > are looking like: > > > > <img alt="2-thumb" src="/images/public/uploaded_images/2- > > thumb.jpg?" /> > > > > 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") # => ''<img alt="Rails" > src="/images/rails.png?1143664135" />'' > > ...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") # => ''<img alt="Rails" > src="/images/rails.png?2345" />'' > > This can be used by deployment managers to set the asset id by > application revision > > -- Jean-Fran?ois. > > -- > ? la renverse. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/f2c6a2c5/attachment.html