我有一个block -iterator来显示一个用户和一个相关的动作,以便每次迭代显示在同一行上?
你可以想像这样的: -Rails:如何让“button_to”按钮出现在同一行(不带换行符)?
user1 update_attribute_button
user2 update_attribute_button.
...
and so on.
但是,如果我用一个button_to方法按钮越做越换行显示。我不want.heres我的代码片段: -
<% @post.bids.each do |bid| %>
<p>
<%= bid.user.email %>
<%= button_to "Offer Bid", offer_bid_post_bid_path(@post, bid), :action => "offer_bid">
</p>
<% end %>
但与上面的代码的“电子邮件”和“要约出价”是出现在两行,但我想将其显示为对,每一对出现在一行上。
我可以使用'link_to'来实现它。
如果我使用'link_to'而不是'button_to',我可以实现我的想法,但不能用button_to来完成。为什么link_to和button_to之间的区别?
我想仅显示'offer bid'作为按钮。
现在,如何使button_to buttin与'email'出现在同一行上。
如果问题的描述不清楚,请让我知道。 在此先感谢。
这也为我工作将这个。谢谢!! – 2012-06-11 17:30:09