Rails content_for in layout view

This doesn’t render anything in browser title bar but shows in page source <meta name=“title” content=“<%= content_for?(:title) ? yield(:title) : “Sitename” %>”>

What’s the name of the file this is in? Is it an ERB file?

If you want to set the tab title in your browser, you need to use the HTML title tag rather than a meta tag.

You’ll want something like this in your layout:

<title><%= content_for?(:title) ? yield(:title) : "Sitename" %></title>

Dear @fugee_ohu

It’s a while since you used rails forums as a place where you could spam your work without making any effort to solve your own problems.

Since I last noticed you, ChatGPT has been invented.

Can I suggest that you start there with your questions, and only post in the forum when

a) ChatGPT doesn’t give you an answer b) You have made a genuine effort to find a solution yourself.

Here is an example of how ChatGPT would have answered your question (assuming you are too lazy to google how to change the title of a webpage).

Easily answered questions are what makes these sites useful to others If you were the site publisher would you want people to take their questions to search engines?

That very clearly shows your disregard for other people’s time.