Changeset 1032
- Timestamp:
- 11/22/07 13:11:01 (1 year ago)
- Files:
-
- trunk/lib/merb/template/erubis.rb (modified) (1 diff)
- trunk/lib/merb/template/haml.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/merb/template/erubis.rb
r1013 r1032 34 34 return sent_template if sent_template 35 35 36 end 37 38 def method_missing(sym, *args, &blk) 39 @_merb_partial_locals[sym] || @web_controller.send(sym, *args, &blk) 40 end 41 36 end 42 37 end 43 38 trunk/lib/merb/template/haml.rb
r765 r1032 36 36 37 37 begin 38 locals_code = build_locals(opts[:locals]) 39 opts[:locals] = {} 38 39 opts[:locals] = {} # Merb handles the locals 40 40 41 41 template = text ? text : load_template(file) 42 42 43 haml = ::Haml::Engine.new( "#{locals_code}#{template}", opts)43 haml = ::Haml::Engine.new(template, opts) 44 44 haml.to_html(view_context) 45 45 rescue … … 68 68 end 69 69 end 70 71 def build_locals(locals)72 locals_code = ""73 if locals74 locals.keys.each do |key|75 locals_code << "- #{key} = @_merb_partial_locals[:#{key}]\n"76 end77 end78 locals_code79 end80 70 81 71 def cache_template?(path)
