mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Delegate freeze_formats to lookup_context
This commit is contained in:
parent
b454bb0a98
commit
0d00d65ad2
2 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@ module ActionView
|
||||||
attr_reader :lookup_context
|
attr_reader :lookup_context
|
||||||
|
|
||||||
delegate :find_template, :template_exists?, :with_fallbacks, :update_details,
|
delegate :find_template, :template_exists?, :with_fallbacks, :update_details,
|
||||||
:with_layout_format, :formats, :to => :lookup_context
|
:with_layout_format, :formats, :freeze_formats, :to => :lookup_context
|
||||||
|
|
||||||
def initialize(view)
|
def initialize(view)
|
||||||
@view = view
|
@view = view
|
||||||
|
@ -33,4 +33,4 @@ module ActionView
|
||||||
ActiveSupport::Notifications.instrument("render_#{name}.action_view", options){ yield }
|
ActiveSupport::Notifications.instrument("render_#{name}.action_view", options){ yield }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -56,7 +56,7 @@ module ActionView
|
||||||
# Renders the given template. An string representing the layout can be
|
# Renders the given template. An string representing the layout can be
|
||||||
# supplied as well.
|
# supplied as well.
|
||||||
def render_template(template, layout_name = nil, locals = {}) #:nodoc:
|
def render_template(template, layout_name = nil, locals = {}) #:nodoc:
|
||||||
lookup_context.freeze_formats(template.formats, true)
|
freeze_formats(template.formats, true)
|
||||||
view, locals = @view, locals || {}
|
view, locals = @view, locals || {}
|
||||||
|
|
||||||
render_with_layout(layout_name, locals) do |layout|
|
render_with_layout(layout_name, locals) do |layout|
|
||||||
|
@ -95,4 +95,4 @@ module ActionView
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue