Sha256: b8f1cf15cd561ed51afef6ffc1462d6678190288ea087d0a752ec0f966d98e94
Contents?: true
Size: 602 Bytes
Versions: 6
Compression:
Stored size: 602 Bytes
Contents
module Munge module Helpers module Link def url_for(item) @router.route(item) end def link_to(item, text = nil, opts = {}) link = url_for(item) if text.is_a?(Hash) opts = text text = nil end optstr = opts.map { |key, val| %(#{key}="#{val}") } parts = [ [ "<a", %(href="#{link}"), optstr ].flatten.join(" "), ">", text || link, "</a>" ] parts.join end end end end
Version data entries
6 entries across 6 versions & 1 rubygems