Show preview with correct type de champ options

fix #3439
This commit is contained in:
Paul Chavard 2019-02-19 16:14:42 +01:00
parent 9a18a154ea
commit aad685bb79
4 changed files with 30 additions and 10 deletions

View file

@ -9,4 +9,12 @@ module ChampHelper
raw(champ.to_render_data.to_json)
# rubocop:enable Rails/OutputSafety
end
def champ_carte_params(champ)
if champ.persisted?
{ champ_id: champ.id }
else
{ type_de_champ_id: champ.type_de_champ_id }
end
end
end