demarches-normaliennes/app/controllers/admin/previsualisations_controller.rb
Xavier J 727c263f72 - Fix bug prévisualisation header
- Fix bug header section visualization
2016-12-22 10:36:18 +01:00

18 lines
No EOL
449 B
Ruby

class Admin::PrevisualisationsController < AdminController
before_action :retrieve_procedure
def show
@procedure
@dossier = Dossier.new(id: 0, procedure: @procedure)
PrevisualisationService.destroy_all_champs @dossier
@dossier.build_default_champs
@champs = @dossier.ordered_champs
@headers = @champs.inject([]) do |acc, champ|
acc.push(champ) if champ.type_champ == 'header_section'
acc
end
end
end