minor refactoring of flash messages

This commit is contained in:
Hauke Klement
2015-03-23 16:42:57 +01:00
parent 2e596110fd
commit 4eef3d70d5
12 changed files with 46 additions and 49 deletions

View File

@ -22,7 +22,7 @@ module ApplicationHelper
def label_column(label)
content_tag(:div, class: 'col-sm-3') do
content_tag(:strong) do
translation_present?("activerecord.attributes.#{label}") ? t("activerecord.attributes.#{label}") : t(label)
I18n.translation_present?("activerecord.attributes.#{label}") ? t("activerecord.attributes.#{label}") : t(label)
end
end
end
@ -60,11 +60,6 @@ module ApplicationHelper
end
end
def translation_present?(key)
I18n.t(key, default: '').present?
end
private :translation_present?
def value_column(value)
content_tag(:div, class: 'col-sm-9') do
block_given? ? yield : symbol_for(value)