The following code from the view worked in Rails 1.1.6 <%= image_tag(url_for(:action => ''picture'', :id => article.picture_id), :size => "110x", :alt => article.picture.label) %> Now it does not work anymore (under Rails 1.2.1) : What is wrong ?? HTML code generated : 1.1.6 <img alt="Alt label" src="/article/picture/3.png?" width="110" /> 1.2.1 <img alt="Alt label" src="/news/picture/3.png" /> There seems to be a difference, what to do ?? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ja Bo :> The following code from the view worked in Rails 1.1.6 > > <%= image_tag(url_for(:action => 'picture', :id => article.picture_id), > :size => "110x", :alt => article.picture.label) %> > > Now it does not work anymore (under Rails 1.2.1) : What is wrong ?? > > HTML code generated : > 1.1.6 > <img alt="Alt label" src="/article/picture/3.png?" width="110" /> > 1.2.1 > <img alt="Alt label" src="/news/picture/3.png" /> > > There seems to be a difference, what to do ??Hi, Suppose the image height is 50 px. You can write : <%= image_tag(url_for(:action => 'picture', :id => article.picture_id), :size => "110x50", :alt => article.picture.label) %> or : <%= image_tag(url_for(:action => 'picture', :id => article.picture_id), :width => "110", :height => '50', :alt => article.picture.label) %> -- Jean-François. -- À la renverse. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Somehow the image is not displayed on the screen, tried your settings but nothing helps... -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I did the following test : TEST 1 => DOESN''T WORK !!! <%= image_tag(url_for(:action => ''picture'', :id => picture.id))%> TEST 2 => DOESN''T WORK !!! <%= link_to(image_tag(url_for(:action => ''picture'', :id => picture.id)), url_for(:action => ''picture'', :id => picture.id)) %> TEST 3 => POP-UP SHOWS IMAGE !! --- IMAGE TAG DOESN''T SHOW THE SAME IMAGE !!! <%= link_to(image_tag(url_for(:action => ''picture'', :id => picture.id), :width => "200", :alt => picture.label), url_for(:action => ''picture'', :id => picture.id), :popup=>true ) %> What can be the reason for this, Rails 1.2.1 bug ?? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ja Bo wrote:> HTML code generated : > 1.1.6 > <img alt="Alt label" src="/article/picture/3.png?" width="110" /> > 1.2.1 > <img alt="Alt label" src="/news/picture/3.png" />Not sure about the width disappearing, but you also seem to have different controllers -- "article" vs "news". You might try either specifying a controller in "url_for" or checking your routes. Asa -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry but that was a mistake when i retyped, in reality they are exactly the same... See my other example : TEST 1 => DOESN''T WORK !!! <%= image_tag(url_for(:action => ''picture'', :id => picture.id))%> TEST 2 => DOESN''T WORK !!! <%= link_to(image_tag(url_for(:action => ''picture'', :id => picture.id)), url_for(:action => ''picture'', :id => picture.id)) %> TEST 3 => POP-UP SHOWS IMAGE !! --- IMAGE TAG DOESN''T SHOW THE SAME IMAGE !!! <%= link_to(image_tag(url_for(:action => ''picture'', :id => picture.id), :width => "200", :alt => picture.label), url_for(:action => ''picture'', :id => picture.id), :popup=>true ) %> Here I have copy pasted from one view file... and I have put the three one below another, so they have access to exactly the same information... !!!! Asa Hopkins wrote:> different controllers -- "article" vs "news". You might try either> Asa-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---