instance method
find_best_by_details
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
find_best_by_details(templates, requested_details)
No documentation comment.
Parameters
-
templatesreq -
requested_detailsreq
Source
# File actionview/lib/action_view/template/resolver.rb, line 218
def find_best_by_details(templates, requested_details)
if templates.size == 1
template = templates.first
return template.details.matches?(requested_details) ? template : nil
end
best = best_rank = nil
templates.each do |template|
rank = template.details.rank_for(requested_details) or next
if best_rank.nil? || (rank <=> best_rank) < 0
best = template
best_rank = rank
end
end
best
end
Defined in actionview/lib/action_view/template/resolver.rb line 218
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::FileSystemResolver