Hi, Using Rails 3.0.3 on Ubuntu 10. In my application controller I have a before filter which checks where or not a User has some comment records. If no comment records our found, a redirection is issued to the main page. All my rspec/cucumber tests passed. So I thought start the server and see what happens when I use Firefox (3.6) or Internet Explorer (1.7) Scenario: Firefox User navigates to page (via AJAX), but has no comments controller/action with format JS is called followed by a redirect (because of the before_filter) redirected to main page with format HTML (not expecting this, wrong behaviour) Internet Explorer User navigates to page (via AJAX), but has no comments controller/action with format JS is called followed by a redirect (because of the before_filter) redirected to main page with format JS (expecting this, correct behaviour) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 6 February 2011 18:06, Wim Neimeijer <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > Using Rails 3.0.3 on Ubuntu 10. > > In my application controller I have a before filter which checks > where or not a User has some comment records. If no comment > records our found, a redirection is issued > to the main page. > > All my rspec/cucumber tests passed. > > So I thought start the server and see what happens > when I use Firefox (3.6) or Internet Explorer (1.7) > > Scenario: > > Firefox > > User navigates to page (via AJAX), but has no comments > controller/action with format JS is called > followed by a redirect (because of the before_filter) > redirected to main page with format HTML (not expecting this, wrong > behaviour) > > Internet Explorer > > User navigates to page (via AJAX), but has no comments > controller/action with format JS is called > followed by a redirect (because of the before_filter) > redirected to main page with format JS (expecting this, correct > behaviour) >Differences with behaviour between browsers is often caused by invalid html. Check the full page source by using View > Page source (or similar ) in the browser and pasting it into the w3c html validator. If that is ok have a look in the log to see what differences there are. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Gummybears Gummybears
2011-Feb-06 20:48 UTC
Re: Difference in redirect_to behaviour (Firefox, IE 7)
Well the HTML is valid (checked with w3c html validator as you mentioned) and the scenario outline are an excerpt from the Rails log. Via google I noticed two people mentioning the same "problem" but alas no solution. A fix was mentioned to set the request.env to js when redirecting or use the :format => "js" in the redirect call. Will test on a different platform and more browsers and report back. Thanks for your help -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.