atraver-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-07 02:20 UTC
Image routing fails on render :update with partial
Hey, gang. I just ran into this problem today, possibly because I''ve added named routes into the mix in my application, or because of some other change I''m unaware of. Either way, it''s completely puzzling. I have a page that updates (renders) a partial when a form is submitted on the same page. The partial contains a few images. On the first run through the page (a fresh reload), the page renders correctly, there are no exceptions in the logs, and everything seems fine. When I submit the form and cause the render :update to occur, however, I get a RoutingError exception to the following tune: Processing ApplicationController#index (for 127.0.0.1 at 2007-02-06 18:12:00) [GET] Session ID: sdfasdfasfasdf Parameters: {"1160418884\\\\\\\""=>nil} ActionController::RoutingError (no route found to match "/contacts/ show/\\\\\\\"/images/world.png" with {:method=>:get}): .//vendor/rails/actionpack/lib/action_controller/routing.rb: 1292:in `recognize_path'' .//vendor/rails/actionpack/lib/action_controller/routing.rb: 1282:in `recognize'' What''s more puzzling is that it actually raises TWO exceptions, one for "/contacts/show/\\\\\\\"/images/world.png" and one for "/contacts/ show/\\\"/images/world.png." It''s strange enough to see these errors occur, but what''s even stranger is that my server is actually still serving the images! I''m running this in dev mode, so my server is Mongrel, although I''m not really sure that matters. Has anyone run into this problem before? Adam --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hello Adam, I ran into the same problem a few days ago when I switched my application from 1.1.6 to 1.2. I discovered that using plain-old html img tags with the src attribute value surrounded by single quotes fixed the issue: <img src="/images/world.png" /> doesn''t work <img src=''/images/world.png'' /> works Could you give it a try and tell us if it works for you? I''m not sure but it may be due to "improper" character escaping in the rendered Javascript. As a side note, I think that your browser displays the images correctly because they are in the cache after the first page load. Simon On Feb 7, 3:20 am, "atra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <atra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey, gang. > > I just ran into this problem today, possibly because I''ve added named > routes into the mix in my application, or because of some other change > I''m unaware of. Either way, it''s completely puzzling. > > I have a page that updates (renders) a partial when a form is > submitted on the same page. The partial contains a few images. On the > first run through the page (a fresh reload), the page renders > correctly, there are no exceptions in the logs, and everything seems > fine. When I submit the form and cause the render :update to occur, > however, I get a RoutingError exception to the following tune: > > Processing ApplicationController#index (for 127.0.0.1 at 2007-02-06 > 18:12:00) [GET] > Session ID: sdfasdfasfasdf > Parameters: {"1160418884\\\\\\\""=>nil} > > ActionController::RoutingError (no route found to match "/contacts/ > show/\\\\\\\"/images/world.png" with {:method=>:get}): > .//vendor/rails/actionpack/lib/action_controller/routing.rb: > 1292:in `recognize_path'' > .//vendor/rails/actionpack/lib/action_controller/routing.rb: > 1282:in `recognize'' > > What''s more puzzling is that it actually raises TWO exceptions, one > for "/contacts/show/\\\\\\\"/images/world.png" and one for "/contacts/ > show/\\\"/images/world.png." It''s strange enough to see these errors > occur, but what''s even stranger is that my server is actually still > serving the images! > > I''m running this in dev mode, so my server is Mongrel, although I''m > not really sure that matters. Has anyone run into this problem before? > > Adam--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
atraver-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-07 19:30 UTC
Re: Image routing fails on render :update with partial
Thanks for the response, Simon. That actually worked somewhat, but it only fixed one of the exceptions. One exception still came through as "no route found to match "/contacts/show/\\''/images/company.png\\''" with {:method=>:get})." I''m assuming the exception is getting thrown because the "catch" code in the JavaScript return is still getting interpretted, if not called. Adam On Feb 6, 11:51 pm, "simonp" <pasquier.si...-GANU6spQydw@public.gmane.org> wrote:> Hello Adam, > > I ran into the same problem a few days ago when I switched my > application from 1.1.6 to 1.2. > > I discovered that using plain-old html img tags with the src attribute > value surrounded by single quotes fixed the issue: > <img src="/images/world.png" /> doesn''t work > <img src=''/images/world.png'' /> works > > Could you give it a try and tell us if it works for you? I''m not sure > but it may be due to "improper" character escaping in the rendered > Javascript. > > As a side note, I think that your browser displays the images > correctly because they are in the cache after the first page load. > > Simon > > On Feb 7, 3:20 am, "atra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <atra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hey, gang. > > > I just ran into this problem today, possibly because I''ve added named > > routes into the mix in my application, or because of some other change > > I''m unaware of. Either way, it''s completely puzzling. > > > I have a page that updates (renders) a partial when a form is > > submitted on the same page. The partial contains a few images. On the > > first run through the page (a fresh reload), the page renders > > correctly, there are no exceptions in the logs, and everything seems > > fine. When I submit the form and cause the render :update to occur, > > however, I get a RoutingError exception to the following tune: > > > Processing ApplicationController#index (for 127.0.0.1 at 2007-02-06 > > 18:12:00) [GET] > > Session ID: sdfasdfasfasdf > > Parameters: {"1160418884\\\\\\\""=>nil} > > > ActionController::RoutingError (no route found to match "/contacts/ > > show/\\\\\\\"/images/world.png" with {:method=>:get}): > > .//vendor/rails/actionpack/lib/action_controller/routing.rb: > > 1292:in `recognize_path'' > > .//vendor/rails/actionpack/lib/action_controller/routing.rb: > > 1282:in `recognize'' > > > What''s more puzzling is that it actually raises TWO exceptions, one > > for "/contacts/show/\\\\\\\"/images/world.png" and one for "/contacts/ > > show/\\\"/images/world.png." It''s strange enough to see these errors > > occur, but what''s even stranger is that my server is actually still > > serving the images! > > > I''m running this in dev mode, so my server is Mongrel, although I''m > > not really sure that matters. Has anyone run into this problem before? > > > Adam--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---