Michael Hartlによるチュートリアルに基づいてWebアプリを作成しました。タイトルタグはすべて、ローカルホストで機能します(実行後rails console
)が、オンライン(ここ)に置くと、タイトルが表示されません。デフォルトでは、ホバーによるタイトル( "Domains Made Simple")になります。
私のアプリはHerokuを介してホストされています。
編集1
これが私のapp/views/layouts/application.html.erb
:
<!DOCTYPE html>
<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<%= stylesheet_link_tag "application", media: "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<%= render 'layouts/shim' %>
</head>
<body>
<%= render 'layouts/header' %>
<div class="container">
<% flash.each do |key, value| %>
<div class="alert alert-<%= key %>"><%= value %></div>
<% end %>
<%= yield %>
<%= render 'layouts/footer' %>
<%= debug(params) if Rails.env.development? %>
</div>
</body>
</html>
編集2
メソッドapp/helpers/application_helper.rb
を含むは次のとおりです。full_title
module ApplicationHelper
def full_title(page_title)
base_title = "Shoulak Predictions"
if page_title.empty?
base_title
else
"#{base_title} | #{page_title}"
end
end
end
編集3
アップデート
思い切って、アレンのコメントに基づいて、私は自分の冒頭をに変更しましapp/views/layouts/application.html.erb
た<title>Shoulak Predictions</title>
。それでも、Hoverの「DomainsMadeSimple」によって上書きされます。