Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Rails Model Translation

    • 0
    • 1
    • 1
    • 2
    • 0
    • 0
    • 0
    • 0
    • 281
    Comment on it

    Rails Model Translation
    Translation in Rails active records is used to provide integration between object and the Rails internationalization (i18n) framework. Rails does this using ActiveModel::Translation.Example:

    class Blog
      extend ActiveModel::Translation

    By using human_attribute_name, attribute names can be transformed into more human format. The human format is usually defined into your locale file as:

    #File: config/locales/
            title: 'Rails'

    You can access this as:

    Blog.human_attribute_name('title') # => "Rails"

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: