Create a gist now

Instantly share code, notes, and snippets.

@tka /view_helpers.rb Secret
Created Feb 20, 2012

Embed
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