Michael Pavling wrote:

> Do you fancy letting the list know what the solution was? ... it may
> help someone else in future.

Erroneous:

  def scale_image_tag(picture, options = {})
    if picture
      #raise options.to_yaml
      image_tag(picture.url(options[:width], options[:height]), 
options.merge({:alt => picture.image_alt, :title => picture.image_alt}))
    else
      image_tag("clear.gif", options)
    end
  end

  def thumbnail_tag(picture, options = {})
    link_to(scale_image_tag(picture, options.merge({:border => 0})), 
"/settings/view_image/#{picture.id}", :popup => ["_blank", 
"width=#{picture.width+15},height=#{picture.height + 10}"])
  end

Working:

  def scale_image_tag(picture, options = {})
    if picture
      image_tag(Picture.image_url(picture.resize(options[:width], 
options[:height])), options.merge({:alt => picture.image_alt, :title => 
picture.image_alt}))
    else
      image_tag("clear.gif", options)
    end
  end

  def thumbnail_tag(picture, options = {})
    link_to(scale_image_tag(picture, options.merge({:border => 0})), 
{:controller => 'settings', :action => 'view_image', :id => picture}, 
:popup => ["_blank", "width=#{picture.width+15},height=#{picture.height 
+ 10}"])
  end
-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to