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)
On 6 February 2011 18:06, Wim N. [email protected] wrote:
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
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