localization snippets

How to find the I18n key and more for ActiveRecord models

Tagged activerecord, i18n, localization  Languages ruby

Use ActiveModel's model_name method to find

User.model_name
User.model_name.i18n_key # => :user
User.model_name.route_key # => :user
User.model_name.partial_path # => users/user

See ActiveModel::Name for more.