How to redirect to ERROR page /500.html in rails

I setup an application in rails while performing some action am getting
below error

Status: 500 Internal Server Error Content-Type: text/html

500 Internal Server Error

page.

using Rails 2.2.2

I want to redirect the user to /500.html

so that they get the error page that looks like our application,.how
could achieve this ??

I don’t remember how the rendering was in Rails 2.2.2, but this is how
I’m doing it in my Rails 2.3.5+ apps

render :file => File.join(Rails.root, ‘public’, ‘500.html’

You might need :layout => false

~Jeremy

Jeremy W. wrote in post #965835:

I don’t remember how the rendering was in Rails 2.2.2, but this is how
I’m doing it in my Rails 2.3.5+ apps

render :file => File.join(Rails.root, ‘public’, ‘500.html’

You might need :layout => false

~Jeremy

Thanks for ur response Jeremy …

am running my application in development mode but soon i switch to
production mode i got what i required without any change …

means my application able to redirect to error page(500.html) as soon as
switch to production mode…

Also, don’t forget to pass the HTTP status code:
render :status=> 500, :file => File.join(…

BUT! Rails will render 500 error page for you, but only on the remote
server,
in the rails sources there is a check if you send a request from the
local pc, it renders trace code to you,
and if you make request from remote PC it will render public/500.html
page for you, without any customizations.

yurokle wrote in post #966008:

Also, don’t forget to pass the HTTP status code:
render :status=> 500, :file => File.join(…

BUT! Rails will render 500 error page for you, but only on the remote
server,
in the rails sources there is a check if you send a request from the
local pc, it renders trace code to you,
and if you make request from remote PC it will render public/500.html
page for you, without any customizations.

Means it has nothing to do with production mode or development mode ??