Displaying 7 results from an estimated 7 matches for "register_template_handl".
Did you mean:
register_template_handler
2006 Jan 22
2
Using register_template_handler to serve CSS files (Making ActionView handle .css as .rhtml)
...t define empty actions with the names I want
my style sheets in (ie: def cooleffects end - that would respond to
/stylesheets/cooleffects).
And in views/styles I have cooleffects.css
Then, I tried the following (both inside the controller, and in a
plugin''s init.rb):
ActionView::Base.register_template_handler ''css'', ActionView::Base
Which doesn''t seem to have any effect, because Rails throws an error on
the CSS file (no matter if I comment the line above):
|No rhtml, rxml, or delegate template found for |<contents of the CSS file>
So, how can I make ActionView hand...
2012 Sep 14
1
calling method on base intended to simulate initialize on instances?
...view/template/handlers/erb''
autoload :Builder, ''action_view/template/handlers/builder''
autoload :Raw, ''action_view/template/handlers/raw''
def self.extended(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...
2006 Mar 12
0
ERB and Builder template engines shouldn''t be so heavily wired in ActionView::Base
...w::Engines::EngineName with these methods:
self::template_exists?( render_options={} )
self::type # return :rhtml, :rxml, :vcrb, etc.
initialize( action_view )
render( render_options={}, local_assigns={} )
4. Only used template engines will be then registered in environment.rb:
ActionView::Base.register_template_handler( ''erb'' )
# does: require( "vendor/erb.rb" )
ActionView::Base.register_template_handler( ''view_controller'' )
# does: require( "vendor/view_controller.rb" )
5. Each required file from vendor registers itself into
@@template_handlers.
@@temp...
2006 Mar 09
0
markably in instance_var mungling
...39; would
help get instance variables in as well as just locals, but ive seen
stranger things especially when delaing with lots of []s and {}s in
TCL...
(1) require ''markaby''
require ''markaby/view''
require ''markaby/helper''
ActionView::Base::register_template_handler :mab, Markaby::View
ActionController::Base.send :include, Markaby::ActionControllerHelper
--
Posted via http://www.ruby-forum.com/.
2007 Jun 26
0
Best way to render KML files using RXML templates
...ond_to do |format|
format.kml { render :action => "kml" }
will render a kml.rxml template I have but really I want to have
action.rxml rendered for kml files.
Is there are way to acheive this, or add an extra extension like
action.kml.rxml that can be picked up ?
Should I be using register_template_handler("kml", ???) and specify
whichever existing class handles the rxml template handling and use
action.rkml for my templates ?
Any pointers would be really helpful.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Gr...
2006 Apr 25
5
markaby or erb?
Guys,
We''re embarking on a new dev project, and I''m curious....why would one
choose markaby over erb? I for one am no fan of the erb syntax, but
aside from that it''s similar to other technologies I''ve used in the
past: PHP, JSP, ASP, etc.
Why would one choose markaby over erb? What are the benefits? What are
the drawbacks? Is there anything remarkable
2006 Mar 03
17
RCSS problems
Hi List!
Following http://rcss.rubyforge.org/files/README.html, I''m trying to get
RCSS to work with Rails. The rcss command itself works fine, but when
trying to access http://localhost:3000/rcss/test.css I always get
"Unknown action - No action responded to test.css", which I don''t
understand since the route and controller are in place.
Anyway, hopefully this is