Apply AJAX for deleting a StockArticle
This commit is contained in:
parent
a511da9ae3
commit
ccf0d010b4
4 changed files with 13 additions and 5 deletions
|
|
@ -33,10 +33,11 @@ class StockitController < ApplicationController
|
|||
|
||||
def destroy
|
||||
StockArticle.find(params[:id]).destroy
|
||||
redirect_to stock_articles_path
|
||||
render :layout => false,
|
||||
:locals => { :destroyed_article_id => params[:id] }
|
||||
rescue => error
|
||||
flash[:error] = "Ein Fehler ist aufgetreten: " + error.message
|
||||
redirect_to stock_articles_path
|
||||
render :partial => "destroy_fail", :layout => false,
|
||||
:locals => { :fail_msg => "Ein Fehler ist aufgetreten: " + error.message }
|
||||
end
|
||||
|
||||
#TODO: Fix this!!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue