Represents a template path within ActionView's lookup and rendering system, like “users/show”
TemplatePath
makes it convenient to convert between separate name, prefix, partial arguments and the virtual path.
Methods
Attributes
[R] | name | |
[R] | partial | |
[R] | partial? | |
[R] | prefix | |
[R] | to_s | |
[R] | to_str | |
[R] | virtual | |
[R] | virtual_path |
Class Public methods
build(name, prefix, partial) Link
Convert name, prefix, and partial into a TemplatePath
new(name, prefix, partial, virtual) Link
parse(virtual) Link
Build a TemplatePath
form a virtual path
# File actionview/lib/action_view/template_path.rb, line 26 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
virtual(name, prefix, partial) Link
Convert name, prefix, and partial into a virtual path string