Rails: content_for not working properly

293 Views Asked by At

Here is my helper method:

  def title(page_title = "RecruitTalk | Tell Your Story")
    page_title = "#{current_user.try(:name) || current_user.try(:email)} | RecruitTalk" if user_signed_in? && current_user.athlete?
    content_for(:title) { page_title }
  end

Here is how I am calling it in my layout file:

<title><%= yield(:title) %></title>

Here is my how I am setting it in a view

<% title "Account Features" %>

When I refresh the page, no page title renders... not sure what I am doing wrong here

0

There are 0 best solutions below