Skip to content

Instantly share code, notes, and snippets.

@mnelson
Created December 17, 2010 22:56
Show Gist options
  • Save mnelson/745860 to your computer and use it in GitHub Desktop.
Save mnelson/745860 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
helper_method :page_title,
:page_description
# ...
end
en:
<meta key pluralized>:
<controller>:
<action>:
<id>: "Some meta value"
en:
page_titles:
users:
new: "Create Your Account"
edit: "Update Your Account"
en:
page_titles:
pages:
show:
tos: "Terms of Service"
pp: "Privacy Policy"
about: "About My Site"
en:
page_titles:
default: "My Super Site"
users:
default: "Manage Your Account"
new: "Create Your Account"
edit: "Update Your Account"
<title><%= page_detail(:page_title) %></title>
<meta name="description" content="<%= page_detail(:page_description) %>" />
<title><%= page_title %></title>
<meta name="description" content="<%= page_description %>" />
def show
@user = User.find(params[:id])
page_detail(:page_title, "#{@user.display_name} :: Profile")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment