refactor(input): don't duplicate hint logic
This commit is contained in:
parent
90e6c8a6f6
commit
49be3a797a
1 changed files with 2 additions and 9 deletions
|
@ -127,6 +127,8 @@ module Dsfr
|
|||
end
|
||||
end
|
||||
|
||||
def hint? = hint.present?
|
||||
|
||||
def password?
|
||||
false
|
||||
end
|
||||
|
@ -142,15 +144,6 @@ module Dsfr
|
|||
def hintable?
|
||||
false
|
||||
end
|
||||
|
||||
def hint?
|
||||
return true if get_slot(:hint).present?
|
||||
|
||||
maybe_hint = I18n.exists?("activerecord.attributes.#{object.class.name.underscore}.hints.#{@attribute}")
|
||||
maybe_hint_html = I18n.exists?("activerecord.attributes.#{object.class.name.underscore}.hints.#{@attribute}_html")
|
||||
|
||||
maybe_hint || maybe_hint_html
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue