Created
October 19, 2011 01:22
-
-
Save coryschires/1297256 to your computer and use it in GitHub Desktop.
layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add to <tt>layout_helper.rb</tt>: | |
def rostra_page_title | |
case "#{controller_name}##{action_name}" | |
when "questions#show" then @question.title | |
when "questions#index" then | |
if params[:tag_search].present? | |
"Recent Questions" | |
else | |
"Recent Questions for tag #{params[:tag_search]}" | |
end | |
when "questions#new" then "Post a new question" | |
when "questions#edit" then "Editing question" | |
when "answers#edit" then "Editing answer" | |
else "Recent Questions" | |
end | |
end | |
# Add to <tt>views/layouts/rostra/application.html.erb</tt>: | |
# <%= rostra_page_title %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment