Sha256: 206dba8a4e3488fd37f5e88988a6f2e9a42d92f2100ba075540e813800e2f58c

Contents?: true

Size: 365 Bytes

Versions: 5

Compression:

Stored size: 365 Bytes

Contents

require 'spire/http'

module Spire
  class MainController
    def render(view, type="haml", data="")
      if type == "html"
        File.open('./app/views/'+view+'.html', 'r').read
      elsif type == "haml"
        file = File.open('./app/views/'+view+'.haml', 'r').read
        Haml::Engine.new(file).render(Object.new, :data => data)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spire-0.1.7 lib/spire/class/MainController.rb
spire-0.1.6 lib/spire/class/MainController.rb
spire-0.1.5 lib/spire/class/MainController.rb
spire-0.1.4 lib/spire/class/MainController.rb
spire-0.1.3 lib/spire/class/MainController.rb