diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/template/handlers/erb.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template/handlers/erb.rb b/actionpack/lib/action_view/template/handlers/erb.rb index a780ab8d85..8993dd2b35 100644 --- a/actionpack/lib/action_view/template/handlers/erb.rb +++ b/actionpack/lib/action_view/template/handlers/erb.rb @@ -37,11 +37,14 @@ module ActionView self.erb_trim_mode = '-' self.default_format = Mime::HTML + + cattr_accessor :erubis_implementation + self.erubis_implementation = Erubis def compile(template) magic = $1 if template.source =~ /\A(<%#.*coding[:=]\s*(\S+)\s*-?%>)/ erb = "#{magic}<% __in_erb_template=true %>#{template.source}" - Erubis.new(erb, :trim=>(self.class.erb_trim_mode == "-")).src + self.class.erubis_implementation.new(erb, :trim=>(self.class.erb_trim_mode == "-")).src end end end |