Zhenjian YU
2006-Aug-24 04:05 UTC
[Rails] Fwd: image_tag keeping add ???? after the url it generates
hi, all, I have a problem with image_tag, the url it generates keeps adding ???? at the tail. e.g. src="/images/gicon.jpg?1153577588??????????" src="/images/gicon.jpg?1153577588?????????????????" I''ve checked the source code of image_tag, and couldn''t find any solution. The ???? is appended to the "source" parameter before it goes to the real image_tag code. def image_tag(source, options = {}) puts source # already ????? here options.symbolize_keys! options[:src] = image_path(source) options[:alt] ||= File.basename (options[:src], ''.*'').split(''.'').first.capitalize if options[:size] options[:width], options[:height] = options[:size].split("x") options.delete :size end tag("img", options) end I couldn''t debug further because I couldn''t find where the image_tag was invoked. I think maybe it''s caused by encoding problem because I use utf8 as the default encoding for the project. Anyone has a solution? Best Regards, Zhenjian --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Peter De Berdt
2006-Aug-24 07:58 UTC
[Rails] Re: Fwd: image_tag keeping add ???? after the url it generates
> Anyone has a solution? >Yes, leave it, it''s a feature. It will cause your user''s browser to reload the image whenever it changes and get it from the cache if no change was made. The parameter is the modification date. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Zhenjian YU
2006-Aug-24 08:31 UTC
[Rails] Re: Fwd: image_tag keeping add ???? after the url it generates
yes, I know that the timestamp figure is the feature. I''m wondering how does those ??????????????? (question signs) come out? When a page with many images is loaded, there are so many ???????????????? (question signs) apear and make the page size really big. I want to find a way to get rid of these ???????????????? (question signs). Regards, Castor On 8/24/06, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> > Anyone has a solution? > > > Yes, leave it, it''s a feature. It will cause your user''s browser to reload > the image whenever it changes and get it from the cache if no change was > made. The parameter is the modification date. > > Best regards > > > Peter De Berdt > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Peter De Berdt
2006-Aug-24 09:21 UTC
[Rails] Re: Fwd: image_tag keeping add ???? after the url it generates
That''s weird indeed, I''ve never come across this. On 24 Aug 2006, at 10:31, Zhenjian YU wrote:> yes, I know that the timestamp figure is the feature. I''m wondering > how does those ??????????????? (question signs) come out? > When a page with many images is loaded, there are so > many ???????????????? (question signs) apear and make the page > size really big. I want to find a way to get rid of > these ???????????????? (question signs). > > Regards, > Castor > > On 8/24/06, Peter De Berdt < peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote: >> Anyone has a solution? >> > > Yes, leave it, it''s a feature. It will cause your user''s browser to > reload the image whenever it changes and get it from the cache if > no change was made. The parameter is the modification date. >>Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Zhenjian YU
2006-Aug-24 09:44 UTC
[Rails] Re: Fwd: image_tag keeping add ???? after the url it generates
I plan to modify the source code of image_tag to strip out those question signs if there weren''t any better solution. On 8/24/06, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> > That''s weird indeed, I''ve never come across this. > > On 24 Aug 2006, at 10:31, Zhenjian YU wrote: > > yes, I know that the timestamp figure is the feature. I''m wondering how > does those ??????????????? (question signs) come out? > When a page with many images is loaded, there are so many ???????????????? > (question signs) apear and make the page > size really big. I want to find a way to get rid of these ???????????????? > (question signs). > > Regards, > Castor > > On 8/24/06, Peter De Berdt < peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote: > > > > Anyone has a solution? > > > > > > Yes, leave it, it''s a feature. It will cause your user''s browser to > > reload the image whenever it changes and get it from the cache if no change > > was made. The parameter is the modification date. > > > > > > > > > > Best regards > > > Peter De Berdt > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Zhenjian YU
2006-Aug-25 01:29 UTC
[Rails] Re: Fwd: image_tag keeping add ???? after the url it generates
ok, I solved this by modifying the source code of image_tag as follows new_source = image_path(source) new_source.gsub!(/\?\?+/,'''') # strip the ending ???? here options[:src] = new_source On 8/24/06, Zhenjian YU <zhenjian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I plan to modify the source code of image_tag to strip out those question > signs if there weren''t any better solution. > > > On 8/24/06, Peter De Berdt < peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote: > > > > That''s weird indeed, I''ve never come across this. > > > > On 24 Aug 2006, at 10:31, Zhenjian YU wrote: > > > > yes, I know that the timestamp figure is the feature. I''m wondering how > > does those ??????????????? (question signs) come out? > > When a page with many images is loaded, there are so many > > ???????????????? (question signs) apear and make the page > > size really big. I want to find a way to get rid of these > > ???????????????? (question signs). > > > > Regards, > > Castor > > > > On 8/24/06, Peter De Berdt < peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote: > > > > > > Anyone has a solution? > > > > > > > > > Yes, leave it, it''s a feature. It will cause your user''s browser to > > > reload the image whenever it changes and get it from the cache if no change > > > was made. The parameter is the modification date. > > > > > > > > > > > > > > > > > Best regards > > > > > > Peter De Berdt > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Zhenjian YU
2006-Nov-04 02:46 UTC
[Rails] image_tag keeping add ???? after the url it generates
hi, all, I have a problem with image_tag, the url it generates keeps adding ???? at the tail. e.g. src="/images/gicon.jpg?1153577588??????????" src="/images/gicon.jpg?1153577588?????????????????" I''ve checked the source code of image_tag, and couldn''t find any solution. The ???? is appended to the "source" parameter before it goes to the real image_tag code. def image_tag(source, options = {}) puts source # already ????? here options.symbolize_keys! options[:src] = image_path(source) options[:alt] ||= File.basename(options[:src], ''.*'').split(''.'').first.capitalize if options[:size] options[:width], options[:height] = options[:size].split("x") options.delete :size end tag("img", options) end I couldn''t debug further because I couldn''t find where the image_tag was invoked. I think maybe it''s caused by encoding problem because I use utf8 as the default encoding for the project. Anyone has a solution? Best Regards, Zhenjian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060824/10a5d8f1/attachment-0001.html