Skip to content

Instantly share code, notes, and snippets.

@tka
Created February 20, 2012 16:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tka/970ce5226b95e2ec52dd to your computer and use it in GitHub Desktop.
Save tka/970ce5226b95e2ec52dd to your computer and use it in GitHub Desktop.
compass.app view_helpers.rb
module ViewHelpers
def new_link_to(name, href, options={})
if href == request.path
options[:class] ||=''
options[:class] += "current"
end
origin_link_to name, href, options
end
def moretext(number=1)
return JSON(open("http://more.handlino.com/sentences.json?n=#{number}").read)["sentences"]
end
end
include ViewHelpers
alias_method :origin_link_to, :link_to
alias_method :link_to, :new_link_to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment