aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/import_tasks_controller.rb2
-rw-r--r--app/controllers/stop_area_copies_controller.rb18
2 files changed, 4 insertions, 16 deletions
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