Terça-feira, 10 de Junho de 2008

How to test Rails error pages?

I'm doing this (in Rails 2.1):

class ContentController < ApplicationController
  def error_pages
    render_optional_error_file(params[:id])
  end
end


And then in my routes:

map.connect '/error_pages/:id', :controller => 'content', :action => 'error_pages' if ENV['RAILS_ENV'] == 'development'

So I can access it with:

http://localhost:3000/error_pages/404
http://localhost:3000/error_pages/500


Does anyone know another solution? =)

0 comentários: