class method self.parse

Ruby on Rails 8.1.2

Since v7.0.10

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

self.parse(virtual)

Build a TemplatePath form a virtual path

Parameters

virtual req
Source
# File actionview/lib/action_view/template_path.rb, line 28
    def self.parse(virtual)
      if nameidx = virtual.rindex("/")
        prefix = virtual[0, nameidx]
        name = virtual.from(nameidx + 1)
        prefix = prefix[1..] if prefix.start_with?("/")
      else
        prefix = ""
        name = virtual
      end
      partial = name.start_with?("_")
      name = name[1..] if partial
      new name, prefix, partial, virtual
    end

Defined in actionview/lib/action_view/template_path.rb line 28 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionView::TemplatePath

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