%p
%br
%span.footer_links
= link_to 'Edit', edit_link_path(@link)
= link_to 'Edit', edit_link_path(@link)
= button_to 'Delete', @link, :confirm => 'Are you sure?', :method => :delete
= button_to 'Delete', @link, :confirm => 'Are you sure?', :method => :delete
pppppp
在同一行上生成“编辑”链接,但在不同行上删除按钮,例如
edit edit
delete
delete
(每个两个用于强调换行符)
我怎样才能在 1 行上获得以上所有内容,如下所示:
edit edit [delete] [delete]
我这样做是因为我需要改变我link_to, :method => :delete
的:button_to's
更新:我在我的 css 中添加:class => '.btn'
了我的 button_to ,.btn { display: inline; }
但它没有帮助。
<p>
<br/>
<span class="footer_links">
<a href="/links/354/edit">Edit</a>
|
</span>
</p>
<form method="post" action="/links/354" class="button_to">
<div>
<input name="_method" type="hidden" value="delete"/>
<input class=".btn" data-confirm="Are you sure?" type="submit" value="Delete"/>
<input name="authenticity_token" type="hidden" value="MvN6K03y5WcqSZRt4Au3zj+xsKhfZ9EEtkf2M7YCGhk="/>
</div>
</form>
<p/>