我有索引页 users_controller:
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'
请告诉我如何修复或告诉我在哪里可以看到工作版本