diff options
| author | Luc Donnet | 2015-04-29 09:51:40 +0200 | 
|---|---|---|
| committer | Luc Donnet | 2015-04-29 09:51:40 +0200 | 
| commit | 88f4c5c64615c46f6a0700cca77e0a5e139f2867 (patch) | |
| tree | 9745e9481aaf1063d0daad59f06e1cf8fdc298e6 /app/controllers/imports_controller.rb | |
| parent | a01fca35dda9116c7ba667c1d5d4aca502eb44c0 (diff) | |
| download | chouette-core-88f4c5c64615c46f6a0700cca77e0a5e139f2867.tar.bz2 | |
Add to import a way to see validation parameters
Diffstat (limited to 'app/controllers/imports_controller.rb')
| -rw-r--r-- | app/controllers/imports_controller.rb | 15 | 
1 files changed, 14 insertions, 1 deletions
diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb index a8a1636c7..51607b835 100644 --- a/app/controllers/imports_controller.rb +++ b/app/controllers/imports_controller.rb @@ -1,10 +1,11 @@ +# coding: utf-8  require 'will_paginate/array'  require 'open-uri'  class ImportsController < ChouetteController    defaults :resource_class => Import -  respond_to :html, :only => [:show, :index, :destroy, :imported_file] +  respond_to :html, :only => [:show, :index, :destroy, :imported_file, :rule_parameter_set]    respond_to :js, :only => [:show, :index]    belongs_to :referential @@ -51,6 +52,18 @@ class ImportsController < ChouetteController        redirect_to referential_path(@referential)      end    end + +  def rule_parameter_set +    begin +      build_breadcrumb :show +      @rule_parameter_set = RuleParameterSet.new(:name => "").tap{ |rps| rps.parameters = resource.rule_parameter_set["validation"] } +      render "rule_parameter_set" +    rescue Ievkit::Error => error +      logger.error("Iev failure : #{error.message}") +      flash[:error] = t('iev.failure') +      redirect_to referential_path(@referential) +    end +  end    protected    alias_method :import, :resource  | 
