我有索引頁users_controller呼籲採取行動:如何從的link_to
def index
@companies = Company.where(:is_confirmed => "f")
respond_to do |format|
format.html # show.html.erb
format.json { render json: @companies }
end
end
,我想在一個按鈕的觸摸,該公司改變了狀態,以證實
def confirm
company = Company.find(params[:id])
company.is_confirmed = "t"
company.save
redirect_to users_path
end
按鈕,應該調用確認
= link_to '<i class="icon-ok icon-white"></i> '.html_safe + t('Confirm'), users_path, confirm: t('Are you sure'), :controller => "users", :action => "confirm", :class => 'btn btn-small btn-success'
請告訴我如何解決或告訴我你在哪裏可以看到一個工作版本
非常感謝你幫我 – Nar
更改爲= link_to''.html_safe + t('確認'),confirm_company_path(公司),確認:t('你確定'),:class =>'btn btn-small btn-success'並且已經工作 – Nar