Reputation: 3428
I have made a web app based off the tutorial by Michael Hartl, and the title tags all work on my localhost (after running rails console
), but when I put it online (here), the titles don't display. It defaults to the titles by hover ("Domains Made Simple").
My app is hosted through Heroku.
Edit 1
Here is my 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>
Edit 2
Here is the app/helpers/application_helper.rb
that contains the full_title
method:
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
Edit 3
Off a hunch, and based off the comment by Alen, I changed the beginning of my app/views/layouts/application.html.erb
to be <title>Shoulak Predictions</title>
. It is still overridden by Hover's "Domains Made Simple".
Upvotes: 0
Views: 258
Reputation: 410652
It's because your domain provider actually hosts its own webpage at your domain, and puts your website in a frameset. You should instead point your domain at your Heroku app, as described in this guide.
Upvotes: 1