Module: Ki::Helpers
Instance Method Summary
collapse
#view_exists?, #view_path
Instance Method Details
7
8
9
|
# File 'lib/ki/helpers.rb', line 7
def css(url)
haml "%link{:href => '#{url}', :rel => 'stylesheet'}"
end
|
15
16
17
|
# File 'lib/ki/helpers.rb', line 15
def haml(s)
Haml::Engine.new(s).render
end
|
11
12
13
|
# File 'lib/ki/helpers.rb', line 11
def js(url)
haml "%script{:src => '#{url}'}"
end
|
#partial(s) ⇒ Object
19
20
21
22
23
|
# File 'lib/ki/helpers.rb', line 19
def partial(s)
path = view_path(s)
raise PartialNotFoundError, path unless File.file?(path)
haml(File.read(path))
end
|