lib/rasti/web/template.rb in rasti-web-2.1.0 vs lib/rasti/web/template.rb in rasti-web-2.1.1

- old
+ new

@@ -2,10 +2,10 @@ module Web class Template def self.render(template, context=nil, locals={}, &block) files = Web.template_engines.map { |e| File.join Web.views_path, "#{template}.#{e}" } - template_file = files.detect { |f| File.exists? f } + template_file = files.detect { |f| File.exist? f } raise "Missing template #{template} [#{files.join(', ')}]" unless template_file tilt = cache.fetch(template_file) { Tilt.new template_file } tilt.render(context, locals, &block) \ No newline at end of file