> Not in application.rb, at that point the object does not exist yet it
> seems. I wonder why I don't see ANY mention whatsoever of such an
> important feature like erubis preprocessing when someone writes about
> "Rails 3 x-times faster"? Or about what it means that erubis is in
> Rails 3 now? Or did I (i.e. Google) overlook some blog post :-)

The preprocessing functionality in Erubis is a little brittle.  It
relies on custom implementations of helpers like link_to which can be
evaluated outsite the context of a request / response and statically
be copied into the template source.  It's kind of a neat trick, but it
won't work out of the box with rails 3 unless the erubis lib gets
updated or other people ship alternative erubis compilers which do
that kind of thing.

In reality, the use of erubis in rails 3 wasn't for performance gains
(which were relatively minor)  but  because it's a much nicer API to
extend and write our own customisations to the rendering phase.
Specifically building the XSS-escaping was quite trivial to do with
erubis but was a huge amount of monkeypatching when I first tried in
with erb.

Don't expect magical performance gains or anything, it's just a nicer
upstream gem for us to use :).


-- 
Cheers

Koz

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-c...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to