Configure MetaTags for Turbo compatibility
mainTo allow Turbo to update the page title via Turbo Streams, you must first configure the <title> tag to have a specific ID in a MetaTags initializer.
- Create
config/initializers/meta_tags.rb:
MetaTags.configure do |config|
config.title_tag_attributes = {id: "page-title"}
end- Use a Turbo Stream in your frame to update the title:
<turbo-stream action="update" target="page-title">
<template>My new title</template>
</turbo-stream># config/initializers/meta_tags.rb
MetaTags.configure do |config|
config.title_tag_attributes = {id: "page-title"}
end