我不认为复选框是您正在寻找的正确控件.您说您希望用户能够批准或拒绝项目,这意味着您有3种状态:未处理,已批准和已拒绝.复选框仅支持2种状态:关闭和打开
我会使用两个链接接受并拒绝,然后执行如下操作.
在你看来:
...... Accept or Reject link_to_remote 'accept', :action => :accept, :id => 1, :method => :post link_to_remote 'reject', :action => :reject, :id => 1, :method => :post
在你的控制器中
def accept item = Item.find(params[:id]) item.accept respond_to do |want| want.js { render :update do |page| page << "$('item_#{item.id}').cells[0].innerHTML = 'Accepted'" ...include other updates you need to make to your row... page.visual_effect :highlight, "item_#{item.id}" end } end end ... similar for reject method ...