我需要将当前订单的 :released 设置为 true
section "Recent orders" do
table_for Order.where(:released => false).all do |t|
t.column("Status") {|order| status_tag (order.released ? "Done" : "Pending"), (order.released ? :ok : :error) }
t.column("User"){|order| link_to order.user.username , admin_user_path(order.user)}
t.column("Created"){|order| order.created_at.to_formatted_s(:short)}
t.column("Price") {|order| order.total_price}
t.column("Actions"){|order| button_tag(:type => 'button') do order.update_attribute(:released, true) end}
end
end
按下按钮后,表中的所有订单都设置为:释放为真。我能做些什么?