0
我希望複製刪除的行爲,我管理與我該如何複製spree刪除行爲?
def destroy
@my_object = Spree::MyObject.find(params[:id])
@my_object.destroy
flash[:success] = Spree.t('notice_messages.object_deleted')
respond_with(@my_object) do |format|
format.html { redirect_to collection_url }
format.js { render :partial => 'destroy' }
end
end
和助手從數據庫中刪除數據
<%= link_to_delete my_object, :url => "#{main_app.admin_objectarea_obejects_url}/#{ad_zone.id}", :no_text => true %>
,但它不火的jQuery的行爲,可笑的是如果更改網址,如"http://0.0.0.0:3000/admin/products/apache-baseball-jersey"
,行爲工作和行被刪除