You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to directly use a Turbo Stream as response instead using it in #respond it could be interesting to have MartenTurbo::TurboStream as as Marten::HTTP::Response.
Example:
classArticleHandler < Marten::Handlers::Schema
schema ArticleHandler
template_name "article_form.html"
success_route_name "articles"
after_successful_schema_validation :turboprivatedefturbo : Nilreturn turbo_stream if request.turbo?
endprivatedefturbo_stream# Creating it here for demonstrating purpose
article =Article.new(schema.validated_data)
article.save!
MartenTurbo::TurboStream.new do |stream|
stream.append("articles", "<div>Article #{article.pk}</div>")
endendend
The text was updated successfully, but these errors were encountered:
Description
In order to directly use a Turbo Stream as response instead using it in #respond it could be interesting to have MartenTurbo::TurboStream as as
Marten::HTTP::Response
.Example:
The text was updated successfully, but these errors were encountered: