跳至内容 跳至搜索
方法
#
A
P
V

实例公共方法

_view_paths()

# File actionview/lib/action_view/view_paths.rb, line 15
def _view_paths
  ActionView::PathRegistry.get_view_paths(self)
end

_view_paths=(paths)

# File actionview/lib/action_view/view_paths.rb, line 19
def _view_paths=(paths)
  ActionView::PathRegistry.set_view_paths(self, paths)
end

append_view_path(path)

将路径追加到此控制器的视图路径列表中。

参数

  • path - 如果提供 String,它将被转换为默认视图路径。您也可以提供自定义视图路径(有关更多信息,请参见 ActionView::PathSet)

# File actionview/lib/action_view/view_paths.rb, line 44
def append_view_path(path)
  self._view_paths = view_paths + _build_view_paths(path)
end

prepend_view_path(path)

将路径置于此控制器的视图路径列表的开头。

参数

  • path - 如果提供 String,它将被转换为默认视图路径。您也可以提供自定义视图路径(有关更多信息,请参见 ActionView::PathSet)

# File actionview/lib/action_view/view_paths.rb, line 54
def prepend_view_path(path)
  self._view_paths = _build_view_paths(path) + view_paths
end

view_paths()

此控制器的所有默认视图路径的列表。

# File actionview/lib/action_view/view_paths.rb, line 59
def view_paths
  _view_paths
end

view_paths=(paths)

设置视图路径。

参数

  • paths - 如果提供 PathSet,则使用它;否则,将参数处理成 PathSet。

# File actionview/lib/action_view/view_paths.rb, line 68
def view_paths=(paths)
  self._view_paths = _build_view_paths(paths)
end