Module: Ki::Middleware::Helpers::View

Included in:
Helpers, KiApp
Defined in:
lib/ki/middleware/helpers/view_helper.rb

Instance Method Summary collapse

Instance Method Details

#view_exists?(path) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
# File 'lib/ki/middleware/helpers/view_helper.rb', line 5

def view_exists?(path)
  path = path.path if path.class == BaseRequest
  File.file?(view_path(path))
end

#view_path(path) ⇒ Object



10
11
12
13
# File 'lib/ki/middleware/helpers/view_helper.rb', line 10

def view_path(path)
  path = path.path if path.class == BaseRequest
  File.join(Ki::VIEWS_PATH, path + '.haml')
end