diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-11-12 11:10:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-12 11:10:39 +0100 |
commit | c813df2ebb0483236d95797d1bb840b48b95d290 (patch) | |
tree | ab68fa4a3cdbb3ba1fba4adbf5c1154ab5f72306 /config/initializers | |
parent | 73b68fcabbbf607d2c1d1021f6063d070edbca26 (diff) | |
parent | 0d43d9926a811dbc14dd5526b179558847640218 (diff) |
Merge pull request #1917 from ClearlyClaire/glitch-soc/fixes/not-recommended-label
Fix “not recommended” label being shown as “recommended”
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/simple_form.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb index 3a2097d2f..92cffc5a2 100644 --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -11,7 +11,10 @@ end module RecommendedComponent def recommended(_wrapper_options = nil) return unless options[:recommended] - options[:label_text] = ->(raw_label_text, _required_label_text, _label_present) { safe_join([raw_label_text, ' ', content_tag(:span, I18n.t('simple_form.recommended'), class: 'recommended')]) } + + key = options[:recommended].is_a?(Symbol) ? options[:recommended] : :recommended + options[:label_text] = ->(raw_label_text, _required_label_text, _label_present) { safe_join([raw_label_text, ' ', content_tag(:span, I18n.t(key, scope: 'simple_form'), class: key)]) } + nil end end |