跳到內容 跳到搜尋
命名空間
方法
N
R
V
包含模組

類別公開方法

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)
  _process_render_template_options(options)
  _render_template(options)
end

view_context()

檢視類別執行個體。預設檢視類別為 ActionView::Base

檢視類別必須具有以下方法

  • View.new(lookup_context, assigns, controller) — 為控制器建立新的 ActionView 執行個體,我們也可以傳遞參數。

  • View#render(選項) — 傳回使用已呈現範本的 字串

在模組中覆寫此方法以變更預設行為。

# 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