search for: template_extension

Displaying 2 results from an estimated 2 matches for "template_extension".

Did you mean: template_extensions
2005 Dec 19
1
Preserving fallback with RJS
...guess I''m looking for a way to specify when I want to render an RJS template over another. Thoughts? Also, I''ll show the code that I think pertains so you can see what might need to be changed. Looking at the render code which controlls which template we go to... def pick_template_extension(template_path)#:nodoc: if match = delegate_template_exists?(template_path) match.first elsif erb_template_exists?(template_path): ''rhtml'' elsif builder_template_exists?(template_path): ''rxml'' elsif javascript_template_exi...
2012 Sep 14
1
calling method on base intended to simulate initialize on instances?
...base) base.register_default_template_handler :erb, ERB.new base.register_template_handler :builder, Builder.new base.register_template_handler :raw, Raw.new end @@template_handlers = {} @@default_template_handlers = nil def self.extensions @@template_extensions ||= @@template_handlers.keys end def register_default_template_handler(extension, klass) register_template_handler(extension, klass) @@default_template_handlers = klass end def register_template_handler(extension, handler) @@template_handlers[extens...