Before Rails 3 I used to set a title instance variable in my controller actions and then use <%=@title%> in my layouts.
But in Rails 3 they have included a helper method
def title(page_title)
@content_for_title = page_title.to_s
end
and in the application.html erb
<title><%= yield(:title) %></title>
This requires us to set title in view templates. Are there any advantages of doing it this way?