Permalink
Browse files

Adds page titles.

  • Loading branch information...
1 parent d9b5eea commit a48cf250cd3392b6e613b6688395c2c4cae69b4d Michael Bleigh committed Mar 23, 2010
Showing with 7 additions and 2 deletions.
  1. +6 −1 gemsday.rb
  2. +1 −1 views/layout.erb
View
@@ -6,10 +6,12 @@
end
get '/about' do
+ @page_title = "About Gemsday"
erb :about
end
get '/tags' do
+ @page_title = "Gem Tags"
@tags = Gemsday::Tag.all
@max = @tags.max{|a,b| a.count <=> b.count}.count
@min = @tags.min{|a,b| a.count <=> b.count}.count
@@ -22,19 +24,22 @@
end
get '/tags/:tag' do
+ @page_title = "'#{params[:tag]}' Gems"
@tag = params[:tag]
@gems = Gemsday::Gem.tagged_with(@tag)
erb :tag
end
get '/people' do
+ @page_title = "Participants"
@tweeters = Gemsday::Tweet.tweeters
erb :people
end
get '/people/:screen_name' do
+ @page_title = "@#{params[:screen_name]}'s Gem Page"
@screen_name = params[:screen_name]
@gems = Gemsday::Gem.mentioned_by(@screen_name)
@@ -43,7 +48,7 @@
get '/gems/:name' do
@gem = Gemsday::Gem.first(:conditions => {:name => params[:name]})
-
+ @page_title = "#{@gem.name}"
erb :gem_page
end
View
@@ -3,7 +3,7 @@
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <title>Gemsday : Spread Some Ruby Around</title>
+ <title>Gemsday : <%= @page_title || 'Spread Some Ruby Around' %></title>
<link rel="stylesheet" href="/stylesheets/master.css" type="text/css" media="screen" charset="utf-8"/>
<link rel="shortcut icon" href="/images/favicon.png"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>

0 comments on commit a48cf25

Please sign in to comment.