Method: Effective::Resources::I18n#human_action_confirm

Defined in:
app/models/effective/resources/i18n.rb

#human_action_confirm(action) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'app/models/effective/resources/i18n.rb', line 22

def human_action_confirm(action)
  if klass.respond_to?(:model_name)
    key = "activerecord.actions.#{klass.model_name.i18n_key}.#{action}_confirm"

    value = ::I18n.t(key)
    return value unless value.include?(key) # missing translation
  end

  "Are you sure you want to #{human_action_name(action).downcase}?"
end