module Roda::RodaPlugins::LinkTo::InstanceMethods
def link_to(body, href, attributes=OPTS)
Return a string with an HTML +a+ tag with an +href+ attribute. See LinkTo
def link_to(body, href, attributes=OPTS) case href when Symbol href = public_send(:"#{href}_path") when String # nothing else href = path(href) end href = h(href) body = href if body.nil? buf = String.new << "<a href=\"#{href}\"" attributes.each do |k, v| buf << " " << k.to_s << "=\"" << h(v) << "\"" end buf << ">" << body << "</a>" end