diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index 2a2ee062..69da3b76 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -195,11 +195,11 @@ class ArticlesController < ApplicationController flash[:error] = 'Keine Aktion ausgewählt!' end # action succeded - redirect_to supplier_articles_path(@supplier) + redirect_to supplier_articles_path(@supplier, :per_page => params[:per_page]) rescue => e flash[:error] = 'Ein Fehler ist aufgetreten: ' + e - redirect_to supplier_articles_path(@supplier) + redirect_to supplier_articles_path(@supplier, :per_page => params[:per_page]) end # lets start with parsing articles from uploaded file, yeah diff --git a/app/views/articles/_articles.html.haml b/app/views/articles/_articles.html.haml index 78c804e1..33d7a17f 100644 --- a/app/views/articles/_articles.html.haml +++ b/app/views/articles/_articles.html.haml @@ -42,15 +42,11 @@ = check_box_tag :checkall, 1, false, :onclick => 'checkUncheckAll(this)' %select{:name => "selected_action"} %option{:value => '', :selected => 'selected'} Aktion wählen ... - %option{:value => "destroy", :onclick => "if (confirm('Willst Du wirklich alle gewählten Artikel löschen?')) { formSubmit(); }; return false;"} Artikel löschen - %option{:value => "setNotAvailable", :onclick => 'formSubmit();'} Artikel sind nicht mehr verfügbar - %option{:value => "setAvailable", :onclick => 'formSubmit();'} Artikel sind verfügbar + %option{:value => "destroy", :onclick => "if (confirm('Willst Du wirklich alle gewählten Artikel löschen?')) { this.up('form').submit(); }; return false;"} Artikel löschen + %option{:value => "setNotAvailable", :onclick => "this.up('form').submit()"} Artikel sind nicht mehr verfügbar + %option{:value => "setAvailable", :onclick => "this.up('form').submit()"} Artikel sind verfügbar = hidden_field_tag 'supplier_id', @supplier.id %p= pagination_links_remote @articles, :params => {:sort => params[:sort]} - -:javascript - function formSubmit() { - $("articlesInListForm").submit() - } \ No newline at end of file += hidden_field_tag :per_page, params[:per_page] \ No newline at end of file