All I want to be able to do is to create an HTML page with a list of links and names/text associated with that text.
E.g. <a href=”www.google.com”>
Where I can change Google
to be any text I want (including data from a variable).
我有:
builder = Nokogiri::HTML::Builder.new do |doc|
doc.html {
doc.body {
contents.each do |i|
doc.p {
doc.a(:href => list.first)
}
end
}
}
end
这只是产生以下结果:
<html><body><p><a href="someurl.com"></a></p></body></html>
我希望:
<html><body><p><a href="someurl.com">First Link</a></p></body></html>
在诺科吉里,我怎么做?
感谢。