Tôi là người mới trong Thế giới Hanami. I'have viết mã này:Hanami link_to helper chỉ hiển thị phần tử cuối
module Web::Views::Home
class Index
include Web::View
include Hanami::Helpers::HtmlHelper
def title
html.header do
h1 'Test search engine', id: 'title'
hr
div(id: 'test') do
link_to('Home', "/", class: 'mnu_orizontal')
link_to('About', "/", class: 'mnu_orizontal')
end
end
end
end
end
tôi gọi title
phương pháp trên mẫu. Kết quả html là:
<header>
<h1 id="title">Test search engine</h1>
<hr>
<div id="test">
<a class="mnu_orizontal" href="/">About</a>
</div>
</header>
Tại sao liên kết thứ hai ghi đè đầu tiên? Lỗi của tôi ở đâu?
Cảm ơn mọi thư trả lời.