跳至内容 跳至搜索
命名空间
方法
N
R
V
包含的模块

属性

[R] rendered_format

类公共方法

new()

# File actionview/lib/action_view/rendering.rb, line 32
def initialize
  @rendered_format = nil
  super
end

实例公共方法

render_to_body(options = {})

# File actionview/lib/action_view/rendering.rb, line 119
def render_to_body(options = {})
  _process_options(options)
  _render_template(options)
end

view_context()

视图类的实例。默认视图类为 ActionView::Base

视图类必须具有以下方法

  • View.new(lookup_context, assigns, controller) — 为控制器创建新的 ActionView 实例,我们还可以传递参数。

  • View#render(option) — 返回已渲染模板的 String

在模块中覆盖此方法以更改默认行为。

# File actionview/lib/action_view/rendering.rb, line 109
def view_context
  view_context_class.new(lookup_context, view_assigns, self)
end

view_context_class()

# File actionview/lib/action_view/rendering.rb, line 95
def view_context_class
  self.class.view_context_class
end