Class: Ki::KiApp
Instance Method Summary
collapse
#view_exists?, #view_path
#render_haml, #render_haml_file
Instance Method Details
#call(env) ⇒ Object
6
7
8
9
10
|
# File 'lib/ki/ki_app.rb', line 6
def call(env)
path = view_exists?('404') ? view_path('404') : custom_view_path
html = render_haml_file(path).strip!
Rack::Response.new(html, 404).finish
end
|
#custom_view_path ⇒ Object
12
13
14
|
# File 'lib/ki/ki_app.rb', line 12
def custom_view_path
File.join(File.dirname(__FILE__), 'views', '404.haml')
end
|