remove invalid excel worksheet characters
This commit is contained in:
parent
ea4bb93bba
commit
fcea7c4f85
2 changed files with 3 additions and 2 deletions
|
@ -36,7 +36,8 @@ class Champs::RepetitionChamp < Champ
|
|||
# We have to truncate the label here as spreadsheets have a (30 char) limit on length.
|
||||
def libelle_for_export
|
||||
str = "(#{type_de_champ.stable_id}) #{libelle}"
|
||||
ActiveStorage::Filename.new(str).sanitized.truncate(30)
|
||||
# /\*?[] are invalid Excel worksheet characters
|
||||
ActiveStorage::Filename.new(str.delete('[]*?')).sanitized.truncate(30)
|
||||
end
|
||||
|
||||
class Row < Hashie::Dash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue