instance method
provide
Ruby on Rails 8.1.2
Since v3.1.12Signature
provide(name, content = nil, &block)
The same as content_for but when used with streaming flushes straight back to the layout. In other words, if you want to concatenate several times to the same buffer when rendering a given template, you should use content_for, if not, use provide to tell the layout to stop looking for more contents.
See ActionController::Streaming for more information.
Parameters
-
namereq -
contentopt = nil -
blockblock
Source
# File actionview/lib/action_view/helpers/capture_helper.rb, line 194
def provide(name, content = nil, &block)
content = capture(&block) if block_given?
result = @view_flow.append!(name, content) if content
result unless content
end
Defined in actionview/lib/action_view/helpers/capture_helper.rb line 194
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::CaptureHelper