Skip to content

Commit

Permalink
Unique titles for every page
Browse files Browse the repository at this point in the history
  • Loading branch information
luontola committed Feb 23, 2018
1 parent 0868fa9 commit 887bfac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app.rb
Expand Up @@ -2,12 +2,14 @@
require 'sinatra/reloader'

get '/' do
@title = "I'm Ruby"
backstreet_boys = ["A.J.", "Howie", "Nick", "Kevin", "Brian"]
@who_i_marry = backstreet_boys.sample
erb :about
end

get '/pictures.html' do
@title = "Lovely Pictures"
@picture_urls = Dir.glob('public/pictures/**').map { |path| path.sub('public', '') }
erb :pictures
end
2 changes: 1 addition & 1 deletion views/layout.erb
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>About</title>
<title><%= @title %></title>
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css">
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/grids-responsive-min.css">
<link rel="stylesheet" href="style.css">
Expand Down

0 comments on commit 887bfac

Please sign in to comment.