tweak link_to

This commit is contained in:
tdreyno 2009-07-29 17:25:20 -07:00
parent 63997274e7
commit 261d345d52

View file

@ -23,8 +23,9 @@ class Middleman < Sinatra::Base
helpers Sinatra::ContentFor helpers Sinatra::ContentFor
helpers do helpers do
def link_to(title, url="#") def link_to(title, url="#", params={})
%Q{<a href="#{url}">#{title}</a>} params = params.map { |k,v| %Q{#{k}="#{v}"}}.join(' ')
%Q{<a href="#{url}" #{params}>#{title}</a>}
end end
end end