Class: Ki::KiApp
Instance Method Summary
collapse
#view_exists?, #view_path
#render_haml, #render_haml_file
Instance Method Details
#call(env) ⇒ Object
8
9
10
11
12
|
# File 'lib/ki/ki_app.rb', line 8
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
14
15
16
|
# File 'lib/ki/ki_app.rb', line 14
def custom_view_path
File.join(File.dirname(__FILE__), 'views', '404.haml')
end
|