Skip to content

Instantly share code, notes, and snippets.

@luc4leone
Created February 28, 2014 09:50
Show Gist options
  • Save luc4leone/9268269 to your computer and use it in GitHub Desktop.
Save luc4leone/9268269 to your computer and use it in GitHub Desktop.
# url = web address
# text = the link
def link(url, text)
"<a href=#{url}>#{text}</a>"
end
p link("http://dontpuzzle.me", "my web site")
# the Output is:
# "<a href=http://dontpuzzle.me>my web site</a>"
# not correct, because it should be: <a href="http://dontpuzzle.me">my web site</a>"
# I tried this:
def link(url, text)
"<a href=\"#{url}\">#{text}</a>"
end
# but it doesn't work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment