Merge remote-tracking branch 'bennibu/rails3' into rails3

Conflicts:
	app/assets/stylesheets/bootstrap_and_overrides.css.less
	app/controllers/stockit_controller.rb
	app/models/ordergroup.rb
	app/models/workgroup.rb
	app/views/stockit/index.html.haml
This commit is contained in:
wvengen 2013-03-06 01:01:12 +01:00
commit 2d382df1f1
10 changed files with 50 additions and 24 deletions

View file

@ -20,7 +20,7 @@ class ArticlesController < ApplicationController
sort = "article_categories.name, articles.name"
end
@articles = Article.where(supplier_id: @supplier).includes(:article_category).order(sort)
@articles = Article.where(supplier_id: @supplier, :type => nil).includes(:article_category).order(sort)
@articles = @articles.where('articles.name LIKE ?', "%#{params[:query]}%") unless params[:query].nil?
@articles = @articles.page(params[:page]).per(@per_page)
@ -231,4 +231,4 @@ class ArticlesController < ApplicationController
redirect_to supplier_articles_path(@supplier), :notice => "Der Katalog ist aktuell."
end
end
end
end

View file

@ -32,11 +32,12 @@ class StockitController < ApplicationController
end
def destroy
StockArticle.find(params[:id]).destroy
redirect_to stock_articles_path
@article = StockArticle.find(params[:id])
@article.destroy
render :layout => false
rescue => error
flash[:error] = I18n.t('errors.general_msg', :msg => error.message)
redirect_to stock_articles_path
render :partial => "destroy_fail", :layout => false,
:locals => { :fail_msg => I18n.t('errors.general_msg', :msg => error.message) }
end
#TODO: Fix this!!