Tôi đang làm gì sai với trình trợ giúp này cho mẫu HAML của tôi?kết quả đầu ra haml_tag trực tiếp vào mẫu Haml
def display_event(event)
event = MultiJson.decode(event)
markup_class = get_markup_class(event)
haml_tag :li, :class => markup_class do
haml_tag :b, "Foo"
haml_tag :i, "Bar"
end
end
Đây là lỗi:
display_eventhaml_tag outputs directly to the Haml template.
Disregard its return value and use the - operator,
or use capture_haml to get the value as a String.
Các mẫu được gọi như thế này:
- @events.each do |event|
= display_event(event)
Nếu tôi đã sử dụng đánh dấu thường xuyên nó sẽ mở rộng như sau
%li.fooclass
%b Foo
%i Bar