我有一个包含三列的表格,并且很难在time_ago_in_words
同一个单元格中添加跟随文档名称。
我尝试了几次不同的迭代都%td= document.name, time_ago_in_words(document.created_at)
无济于事。
哈姆勒:
%table.table.table-striped
%thead
%tr
%th Name
%th Download Link
%th
%tbody
- @documents.each do |document|
%tr
%td= document.name
%td= link_to "Download Document", document.attachment_url
%td= button_to "Delete", document, method: :delete, class: "btn btn-danger", confirm: "Are you sure that you wish to delete #{document.name}?"