Last active
August 29, 2015 14:23
-
-
Save Hates/bcce9c5c1de690eb4364 to your computer and use it in GitHub Desktop.
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
def hashtag_finder(text) | |
text.split.collect { |s| s.starts_with?("#") ? build_link(s): s }.join(" ") | |
end | |
def build_link(matched) | |
"<span class='darkredlink'>#{link_to matched, search_path(:q => matched)}</span>" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment