views:

54

answers:

1

I've come across a weird bug for ie7 where the css styles get applied differently when I access "/400.html" and "/500.html" directly as opposed to being redirected to it by a controller.

The controller code for redirection is:

respond_to do |format|  
  format.html { render :file => "#{RAILS_ROOT}/public/404.html", :status => "404 Not Found" }  
  format.all { render :nothing => true, :status => "404 Not Found" }  
end

The styles are exactly the same for ff and safari. I've tried clearing the cache and restarting the server several times as well.

Anyone have any ideas?

A: 

When you call render :file, the current layout is not applied. Are you including a stylesheet in a default layout that is not included in the 404 page? If so, you need to call

render :file => whatever, :status => "404 Not Found", :layout => true
nfm