instance method find_best_by_details

Ruby on Rails edge

Since edge Private — implementation detail, not part of the public API

Signature

find_best_by_details(templates, requested_details)

No documentation comment.

Parameters

templates req
requested_details req
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

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close