Method: Olivander::ApplicationHelper#resource_form_action_label

Defined in:
app/helpers/olivander/application_helper.rb

#resource_form_action_label(resource, action) ⇒ Object



97
98
99
100
101
102
103
# File 'app/helpers/olivander/application_helper.rb', line 97

def resource_form_action_label(resource, action)
  key = resource.class.name.underscore
  return O18n.t("activerecord.actions.#{key}.#{action}") if I18n.exists?("activerecord.actions.#{key}.#{action}")
  return O18n.t("activerecord.actions.#{action}") if I18n.exists?("activerecord.actions.#{action}")

  action.to_s.titleize
end