Sha256: 89228f035de83aa41e3e57e3f9dc54cf222323c225f4e882c0e857df3b34be46

Contents?: true

Size: 412 Bytes

Versions: 3

Compression:

Stored size: 412 Bytes

Contents

# encoding:utf-8
module TranslationsHelper
  def plural_name(resource)
    t "#{resource}.plural", default: resource.singularize.camelize.constantize.model_name.human
  end

  def accusative_case(resource)
    t "#{resource}.accusative", default: resource.singularize.camelize.constantize.model_name.human
  end

  def action_accusative(resource, action)
    t(action) + " " + accusative_case(resource)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ideyabox-0.1.12 lib/generators/ideyabox/admin/templates/helpers/translations_helper.rb
ideyabox-0.1.11 lib/generators/ideyabox/admin/templates/helpers/translations_helper.rb
ideyabox-0.1.10 lib/generators/ideyabox/admin/templates/helpers/translations_helper.rb