Standard Co / Field Notes /
Dynamically setting the <head> from a view
The Standard Co Blog

Dynamically setting the <head> from a view

TM
TJ Muehleman
February 23, 2021

We work mostly in the ruby on rails stack. Recently I had an issue where I wanted to dynamically change info that was set in the <head> -- in our sites (and most rails sites), this is controlled by an application layout. So how do you let the view control info in the layout? Easy: content_for: In your view

And in your layout