我試圖重寫下面的按鈕代碼,以便不是將我重定向到show
頁面,而是創建對象並保持顯示當前頁面。我想重寫一個button_to
<div class="colors">
<li class="colors" id="greys">
<%= button_to "some text", votes_path(color: 'grey', kid_id: current_kid, scoop_id: scoop.id, :method => :create), class: 'grey color-button' %>
</li>
</div>