Module: AwesomeForm::Methods::Labels

Included in:
FormBuilder
Defined in:
lib/awesome_form/methods/labels.rb

Instance Method Summary collapse

Instance Method Details

#action_label(action) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/awesome_form/methods/labels.rb', line 9

def action_label(action)
  I18n.t("awesome_form.actions.#{resource_name}.#{action}", {
    default: I18n.t("awesome_form.actions.#{action}", {
      default: action.to_s.humanize
    })
  })
end

#input_label(attribute_name) ⇒ Object



5
6
7
# File 'lib/awesome_form/methods/labels.rb', line 5

def input_label(attribute_name)
  I18n.t("awesome_form.labels.#{resource_name}.#{attribute_name}", default: attribute_name.to_s.humanize)
end