Skip to content

Instantly share code, notes, and snippets.

@tmking
Created July 31, 2009 16:24
Show Gist options
  • Save tmking/159301 to your computer and use it in GitHub Desktop.
Save tmking/159301 to your computer and use it in GitHub Desktop.

Revisions

  1. tmking revised this gist Jul 31, 2009. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  2. tmking revised this gist Jul 31, 2009. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  3. tmking created this gist Jul 31, 2009.
    40 changes: 40 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    def set_page_title
    @uri = request.request_uri.split("/")
    if is_current_section('brands')
    if @uri[2] then
    " - Our Brands: #{@uri[2].capitalize}"
    else
    " - Our Brands"
    end
    elsif is_current_section('pianofinder') then
    " - Find the Best Piano for You"
    elsif is_current_section('education') then
    " - Our Education Programs"
    elsif is_current_section('service') then
    " - Tuning and Service"
    elsif is_current_section('quiz') then
    " - The Ultimate Piano Quiz"

    elsif is_current_section('about') then
    " - About Us"
    elsif is_current_section('stores') then
    " - Store Locator"
    elsif is_current_section('tenreasons') then
    " - Ten Reasons to Buy From Us"
    elsif is_current_section('institutional') then
    " - Institutional Sales & Service"
    elsif is_current_section('events') then
    " - Upcoming Events"
    elsif is_current_section('rentals') then
    " - Rent a Piano"
    elsif is_current_section('didyouknow') then
    " - Did You Know?"
    elsif is_current_section('chinese') || is_current_section('korean') then
    " - For our #{@uri[1].capitalize} Customers"
    elsif is_current_section('contact') then
    " - Contact Us"
    elsif is_current_section('restoration') then
    " - Piano Restoration Center"
    elsif is_current_section('showcase') then
    " - Showcase Center"
    end
    4 changes: 4 additions & 0 deletions gistfile2.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    def set_title(page_title)
    content_for(:title) { "- #{page_title}" }
    content_for(:h1) { page_title }
    end