Skip to content

Instantly share code, notes, and snippets.

@coryschires
Created October 19, 2011 01:22
Show Gist options
  • Save coryschires/1297256 to your computer and use it in GitHub Desktop.
Save coryschires/1297256 to your computer and use it in GitHub Desktop.
layout
# 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