例如,在下表中,我在我的应用程序中反复使用这些操作,我不太确定如何干它,部分视图或铁路助手(这似乎不适合处理用html片段)...(我正在使用Slim btw)
我希望能够做到这样的事情: = edit_button(路径,'可选显示文本','可选的额外类)
table.grid
thead
tr
th Researcher
th Email Address
th Last Activity
th Activated
th Failed logins
th Locked
th Actions
tbody
- @users.each do |user|
tr
td
= "#{user.first_name} #{user.last_name}"
td
= user.email
td
| About 1 day ago
td
| Yes
td
= user.failed_logins_count
td
| No
td
div.actions
a.small.button.edit href=edit_user_path(user)
i.general.foundicon-edit
| Edit
a.small.button.delete href=user_path(user) method='delete' data-confirm='Are you sure?'
i.general.foundicon-trash
| Delete