Module: Glib::FormsHelper
- Defined in:
- app/helpers/glib/forms_helper.rb
Instance Method Summary collapse
- #glib_form_field_label(model_name, prop, args = {}) ⇒ Object
- #glib_form_hint_label(model_name, prop, args = {}) ⇒ Object
- #glib_form_placeholder_label(model_name, prop, args = {}) ⇒ Object
Instance Method Details
#glib_form_field_label(model_name, prop, args = {}) ⇒ Object
3 4 5 6 7 |
# File 'app/helpers/glib/forms_helper.rb', line 3 def glib_form_field_label(model_name, prop, args = {}) I18n.t("dt_models.#{model_name}.#{prop}.label", **args.merge(default: nil)) || I18n.t("activerecord.attributes.#{model_name}.#{prop}", **args.merge(default: nil)) || I18n.t("activemodel.attributes.#{model_name}.#{prop}", **args) end |
#glib_form_hint_label(model_name, prop, args = {}) ⇒ Object
9 10 11 |
# File 'app/helpers/glib/forms_helper.rb', line 9 def glib_form_hint_label(model_name, prop, args = {}) I18n.t("dt_models.#{model_name}.#{prop}.hint", **args.merge(default: nil)) end |
#glib_form_placeholder_label(model_name, prop, args = {}) ⇒ Object
13 14 15 |
# File 'app/helpers/glib/forms_helper.rb', line 13 def glib_form_placeholder_label(model_name, prop, args = {}) I18n.t("dt_models.#{model_name}.#{prop}.placeholder", **args.merge(default: nil)) end |