instance method broadcast_rendering_with_defaults

Ruby on Rails 1.4.0

Since v1.3.3 Last seen in v2.0.23 Private

Available in: v1.3.3 v1.4.0 v1.5.0 v2.0.23

Signature

broadcast_rendering_with_defaults(options)

No documentation comment.

Parameters

options req
Source
# File app/models/concerns/turbo/broadcastable.rb, line 347
    def broadcast_rendering_with_defaults(options)
      options.tap do |o|
        # Add the current instance into the locals with the element name (which is the un-namespaced name)
        # as the key. This parallels how the ActionView::ObjectRenderer would create a local variable.
        o[:locals] = (o[:locals] || {}).reverse_merge!(model_name.element.to_sym => self)

        if o[:html] || o[:partial]
          return o
        elsif o[:template]
          o[:layout] = false
        else
          # if none of these options are passed in, it will set a partial from #to_partial_path
          o[:partial] ||= to_partial_path
        end
      end
    end

Defined in app/models/concerns/turbo/broadcastable.rb line 347 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Turbo::Broadcastable

Type at least 2 characters to search.

↑↓ navigate · open · esc close