Sha256: ac9a08e784d6ab998418fb6f0de7504f4ecefd032d8096db30e02a704ca93f0f

Contents?: true

Size: 644 Bytes

Versions: 1

Compression:

Stored size: 644 Bytes

Contents

require 'haml/util'
require 'haml/engine'

module Ramaze
  module View
    module Haml
      def self.call(action, string)
        options = action.options

        if haml_options = action.instance.ancestral_trait[:haml_options]
          options = options.merge(haml_options)
        end
        action.sync_variables(action)
        action.options[:filename] = (action.view || '(haml)')

        haml = View.compile(string) do |s| 
          ::Haml::Engine.new(s,options).render_proc(action.instance,*action.variables.keys) 
        end
        html = haml.call action.variables

        return html, 'text/html'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ramaze-2010.01 lib/ramaze/view/haml.rb