Sha256: fdd4b43e2f22b2b36e3b5c9d54ff2ed7d1c6abd51d8fe0ccda6cfa2d3a99d917

Contents?: true

Size: 1 KB

Versions: 2

Compression:

Stored size: 1 KB

Contents

# ActsAsLocalized
[![Gem Version](https://img.shields.io/gem/v/acts_as_localized.svg?style=flat)](http://rubygems.org/gems/acts_as_localized) [![Gem Downloads](https://img.shields.io/gem/dt/acts_as_localized.svg?style=flat)](http://rubygems.org/gems/acts_as_localized) [![Build Status](https://img.shields.io/travis/GBH/acts_as_localized.svg?style=flat)](https://travis-ci.org/GBH/acts_as_localized)

ActsAsLocalized extends ActiveRecord to add localization mechanism for model attributes.

## Example

```ruby
create_table :pictures do |t|
  t.string :title_en
  t.string :title_fr
  t.text :description_en
  t.text :description_fr
end

class Picture < ActiveRecord::Base
  acts_as_localized :title, :description
end

picture = Picture.create!(
  :title_en       => 'Title EN',
  :title_fr       => 'Title FR',
  :description_en => 'Description EN',
  :description_fr => 'Description FR',
)

I18n.locale = :en
picture.title # => Title EN
I18n.locale = :fr
picture.title # => Title FR
```

---

Copyright 2015 Oleg Khabarov

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_localized-0.0.2 README.md
acts_as_localized-0.0.1 README.md