-
-
Save tka/970ce5226b95e2ec52dd to your computer and use it in GitHub Desktop.
compass.app view_helpers.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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