View adapter for Slippers, see the website of Slippers for more information: starapor.github.com/slippers/
# File lib/ramaze/view/slippers.rb, line 13 13: def self.call(action, string) 14: slippers = View.compile(string) do |s| 15: ::Slippers::Engine.new(s, :template_group => template_group(action)) 16: end 17: 18: object_to_render = ::Slippers::BindingWrapper.new(action.instance.binding) 19: html = slippers.render(object_to_render) 20: 21: return html, 'text/html' 22: end
# File lib/ramaze/view/slippers.rb, line 26 26: def self.template_group(action) 27: subtemplates = action.instance.ancestral_trait[:slippers_options] || {} 28: missing_template_handler = action.instance.ancestral_trait[ 29: :slippers_missing_template_handler 30: ] 31: default_string = action.instance.ancestral_trait[ 32: :slippers_default_string 33: ] 34: 35: views = action.instance.options[:views].map do |view| 36: "#{action.instance.options[:roots]}/#{view}" 37: end 38: 39: super_group = ::Slippers::TemplateGroup.new( 40: :templates => subtemplates, 41: :missing_template_handler => missing_template_handler, 42: :default_string => default_string 43: ) 44: 45: ::Slippers::TemplateGroupDirectory.new( 46: views, :super_group => super_group, 47: :missing_template_handler => missing_template_handler, 48: :default_string => default_string 49: ) 50: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.