【发布时间】:2020-02-10 12:04:26
【问题描述】:
我的一个助手中有以下代码:
def send_fragments_to_other_template(template, counter)
if counter == 0
content_tag "div", class: "card w-5c" do
content_tag "div", class: "card__content resource" do
content_tag "h4" do
content_tag "span", "Send fragments to other template"
end
link_to "Send", edit_admin_template_fragment_path(template), class: "btn btn--s-purple", remote: true
end
end
end
end
问题出在这里:无论出于何种原因,rails 都忽略了第三个和第四个内容标签。我在页面上有两个 div 和按钮(锚点),但没有 h4 或 span。
我做错了什么?
【问题讨论】:
标签: ruby-on-rails ruby helper content-tag