1
我的表单中有两个按钮,我使用CSS工作表来布置表格,我想要最后一行中的按钮,但我希望它们并排放置。使用rails代码,css和html对齐按钮
我当前的代码看起来像
<button><%= link_to "Edit", edit_user_path(u.id), { :method =>get } %></button>
<button><%= link_to "Delete", user_path(u.id), { :method => delete, :class=>destroy, data: {confirm: 'Are you sure?' } %></button>
如果我将其更改为:
<button><%= button_to "Edit", edit_user_path(u.id), { :method =>get } %></button>
<button><%= button_to "Delete", user_path(u.id), { :method => delete, :class=>destroy, data: {confirm: 'Are you sure?' } %></button>
按钮结束并排,但与按钮标签中的额外按钮。 如果我将其更改为:
<td><%= button_to "Edit", edit_user_path(u.id), { :method =>get } %>
<%= button_to "Delete", user_path(u.id), { :method => delete, :class=>destroy, data: {confirm: 'Are you sure?' } %></td>
的按钮是在同一行,但水平神韵:。
有没有办法让这两个按钮正确显示在列的中心?也许可以在CSS中添加一些内容,告诉它如何处理按钮调用?
我不明白的问题......他们在你的第一个图像中并排是不是他们? – Lee
他们并肩作战,我期待着看看是否有更好的方法来做到这一点,或者让他们一致。 –
问题是'button_to'没有创建'