mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Extract finding the template in AC to it's own method
This commit is contained in:
parent
e0f1a7dc19
commit
dd34691b8d
1 changed files with 5 additions and 3 deletions
|
@ -112,11 +112,13 @@ module AbstractController
|
|||
name = (options[:_template_name] || action_name).to_s
|
||||
|
||||
options[:_template] ||= with_template_cache(name) do
|
||||
view_paths.find(
|
||||
name, { :formats => formats }, options[:_prefix], options[:_partial]
|
||||
)
|
||||
find_template(name, { :formats => formats }, options)
|
||||
end
|
||||
end
|
||||
|
||||
def find_template(name, details, options)
|
||||
view_paths.find(name, details, options[:_prefix], options[:_partial])
|
||||
end
|
||||
|
||||
def with_template_cache(name)
|
||||
yield
|
||||
|
|
Loading…
Reference in a new issue