instance method view_context

Ruby on Rails 4.2.9

Since v4.1.16

Available in: v4.1.16 v4.2.9 v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

view_context()

An instance of a view class. The default view class is ActionView::Base

The view class must have the following methods: View.new[lookup_context, assigns, controller]

Create a new ActionView instance for a controller and we can also pass the arguments.

View#render(option)

Returns String with the rendered template

Override this method in a module to change the default behavior.

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

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

Defined in ActionView::Rendering

Type at least 2 characters to search.

↑↓ navigate · open · esc close