From e1c8a62852616fcfcc6a79b6cc4aefc50e4bd628 Mon Sep 17 00:00:00 2001 From: Michel Etienne Date: Fri, 29 Aug 2014 11:44:05 +0200 Subject: active pagination on remote --- app/controllers/import_tasks_controller.rb | 2 +- app/controllers/stop_area_copies_controller.rb | 18 +++--------------- 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/import_tasks_controller.rb b/app/controllers/import_tasks_controller.rb index 37de83f4d..1d7e8c3aa 100644 --- a/app/controllers/import_tasks_controller.rb +++ b/app/controllers/import_tasks_controller.rb @@ -1,6 +1,6 @@ class ImportTasksController < ChouetteController respond_to :html, :xml, :json - respond_to :js, :only => :show + respond_to :js, :only => [:show, :index] belongs_to :referential def new diff --git a/app/controllers/stop_area_copies_controller.rb b/app/controllers/stop_area_copies_controller.rb index 01dfc5894..dbb66c2bd 100644 --- a/app/controllers/stop_area_copies_controller.rb +++ b/app/controllers/stop_area_copies_controller.rb @@ -7,25 +7,13 @@ class StopAreaCopiesController < ChouetteController respond_to :html, :only => :new def new - @stop_area_copy = StopAreaCopy.new(:source_id => parent.id, :hierarchy => params[:hierarchy]) - if @stop_area_copy.hierarchy == "child" - if parent.area_type.underscore == "stop_place" - @stop_area_copy.area_type="commercial_stop_point" - else - @stop_area_copy.area_type="boarding_position" - end - else - if parent.area_type.underscore == "stop_place" || parent.area_type.underscore == "commercial_stop_point" - @stop_area_copy.area_type="stop_place" - else - @stop_area_copy.area_type="commercial_stop_point" - end - end + @stop_area_copy = StopAreaCopy.new(:hierarchy => params[:hierarchy], :source => parent) new! end -# TODO + def create @stop_area_copy = StopAreaCopy.new(params[:stop_area_copy]) + @stop_area = parent if @stop_area_copy.save redirect_to referential_stop_area_path( @referential,parent ), notice: I18n.t("stop_area_copies.new.success") else -- cgit v1.2.3