Sha256: 7edfed101c5cca39f498ad4b96c30d940010049e9f6bc8b11e66438769e55d35

Contents?: true

Size: 459 Bytes

Versions: 1

Compression:

Stored size: 459 Bytes

Contents

# frozen_string_literal: true

module Ki
  module Helpers
    include Middleware::Helpers::View

    def css(url)
      haml "%link{:href => '#{url}', :rel => 'stylesheet'}"
    end

    def js(url)
      haml "%script{:src => '#{url}'}"
    end

    def haml(s)
      Haml::Engine.new(s).render
    end

    def partial(s)
      path = view_path(s)
      raise PartialNotFoundError, path unless File.file?(path)
      haml(File.read(path))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ki-0.4.12 lib/ki/helpers.rb