0 votes
in Ruby by

What is the correct syntax for inserting a dynamic title tag into the header of your page from within an ERB view template?

 A.

<% render :head do %>

  <title>My page title</title>

<% end %>

 B.

<% content_for :head do %>

  <title>My page title</title>

<% end %>

 C.

<% render "shared/head, locals: {title: "My page title"} %>

 D.

<% tield :head do %>

  <title>My page title</title>

<% end %>

1 Answer

0 votes
by

What is the correct syntax for inserting a dynamic title tag into the header of your page from within an ERB view template?

Correct answer is :- <% render "shared/head, locals: {title: "My page title"} %>

Related questions

0 votes
asked Sep 2, 2022 in Ruby by DavidAnderson
0 votes
asked Sep 3, 2022 in Ruby by DavidAnderson
...