Class: Waves::Views::Errors

Inherits:
Base show all
Includes:
Helpers::DocType
Defined in:
lib/views/errors.rb

Constant Summary

Constants included from Helpers::DocType

Helpers::DocType::DOCTYPES

Instance Attribute Summary

Attributes included from Mixin

#request

Instance Method Summary collapse

Methods included from Helpers::DocType

#doctype

Methods included from Mixin

included, #initialize, #method_missing, #render, #renderer

Methods included from ResponseMixin

#app, #app_name, #attributes, #basename, #captured, #extension, #log, #model, #model_name, #params, #paths, #query, #redirect, #render, #resource, #response, #traits

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Waves::Views::Mixin

Instance Method Details

#header(title) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/views/errors.rb', line 8

def header( title )
  "  <head>\n    <title>\#{title}</title>\n    <style>\n      body { background: #933; padding: 20px; font-family: verdana, sans-serif; }\n      h1 { font-size: 60px; font-weight: bold; }\n      p { font-size: 24px; }\n    </style>\n  </head>\n  HTML\nend\n"

#not_found_404Object



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/views/errors.rb', line 21

def not_found_404
  DOCTYPES[ :html4_transitional ]
  "  <html>\n    \#{ header( '404: Not Found' ) }\n    <body>\n      <h1>404</h1>\n      <p>That URL does not exist on this server.</p>\n    </body>\n  </html>\n  HTML\nend\n"

#server_error_500Object



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/views/errors.rb', line 34

def server_error_500
  DOCTYPES[ :html4_transitional ]
  "  <html>\n    \#{ header( '500: Server Error' ) }\n    <body>\n      <h1>404</h1>\n      <p>Internal server error. Sorry, but your request could not be processed.</p>\n    </body>\n  </html>\n  HTML\nend\n"