Sha256: 9f4a20a982e435dd35a5bd766489571a94002e8e20d05317620b04c84d79aef1

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

require 'helpers/doc_type'
module Waves
  module Views
    class Errors < Waves::Views::Base
      
      include Waves::Helpers::DocType
      
      def header( title )
        <<-HTML
        <head>
          <title>#{title}</title>
          <style>
            body { background: #933; padding: 20px; font-family: verdana, sans-serif; }
            h1 { font-size: 60px; font-weight: bold; }
            p { font-size: 24px; }
          </style>
        </head>
        HTML
      end
    
      def not_found_404
        DOCTYPES[ :html4_transitional ]
        <<-HTML
        <html>
          #{ header( '404: Not Found' ) }
          <body>
            <h1>404</h1>
            <p>That URL does not exist on this server.</p>
          </body>
        </html>
        HTML
      end
    
      def server_error_500
        DOCTYPES[ :html4_transitional ]
        <<-HTML
        <html>
          #{ header( '500: Server Error' ) }
          <body>
            <h1>500</h1>
            <p>Internal server error. Sorry, but your request could not be processed.</p>
          </body>
        </html>
        HTML
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
waves-edge-2009.03.10.13.14 lib/views/errors.rb