Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stream Tag Builder: Support
:renderable
arguments
When passed a valid `:renderable` option (like an object that responds to `#render_in`), treat that object as both the `<turbo-stream>` element's template contents _and_ attempt to treat it as the target. For example, consider a simplified "component" class: ```ruby class Component extend ActiveModel::Naming def initialize(id:, content:) = (@id, @content = id, content) def render_in(...) = @content def to_key = [@id] end component = Component.new(id: 1, content: "Hello, world") turbo_stream.update(component) # => <turbo-stream action="update" target="component_1"><template>Hello, world</template></turbo-stream> ```
- Loading branch information