mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Move erb_trim_mode setting to the ERB template handler. Keep a Base.erb_trim_mode= delegator around.
This commit is contained in:
@@ -161,10 +161,9 @@ module ActionView #:nodoc:
|
||||
|
||||
attr_accessor :output_buffer
|
||||
|
||||
# Specify trim mode for the ERB compiler. Defaults to '-'.
|
||||
# See ERb documentation for suitable values.
|
||||
@@erb_trim_mode = '-'
|
||||
cattr_accessor :erb_trim_mode
|
||||
class << self
|
||||
delegate :erb_trim_mode=, :to => 'ActionView::TemplateHandlers::ERB'
|
||||
end
|
||||
|
||||
# Specify whether file modification times should be checked to see if a template needs recompilation
|
||||
@@cache_template_loading = false
|
||||
|
||||
@@ -42,8 +42,13 @@ module ActionView
|
||||
class ERB < TemplateHandler
|
||||
include Compilable
|
||||
|
||||
# Specify trim mode for the ERB compiler. Defaults to '-'.
|
||||
# See ERb documentation for suitable values.
|
||||
cattr_accessor :erb_trim_mode
|
||||
self.erb_trim_mode = '-'
|
||||
|
||||
def compile(template)
|
||||
::ERB.new(template.source, nil, @view.erb_trim_mode, '@output_buffer').src
|
||||
::ERB.new(template.source, nil, erb_trim_mode, '@output_buffer').src
|
||||
end
|
||||
|
||||
def cache_fragment(block, name = {}, options = nil) #:nodoc:
|
||||
|
||||
Reference in New Issue
Block a user