Skip to content

Instantly share code, notes, and snippets.

@dariocravero
Last active December 15, 2015 19:39
Show Gist options
  • Save dariocravero/5313088 to your computer and use it in GitHub Desktop.
Save dariocravero/5313088 to your computer and use it in GitHub Desktop.
module MyApp
module CommonViewHelper
def self.registered(app)
app.helpers Helpers
end
alias :included :registered
module Helpers
def page_title(title="")
@base_title = "Test Titke"
title.blank? ? @base_title : "#{title} | #{@base_title}"
end
def page_description(description="")
description.blank? ? "Test Desc" : truncate(description, length: 160)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment