Repository is archived
No commit activity in last 3 years
No release in over 3 years
[description]
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 3.0.10
= 0.5.0
>= 0
= 2.5.0
 Project Readme

translates_fields

Build status

Provides a way of storing and retreiving tranlsation keys and options in your ActiveRecord models.

Installation

Add gem 'translates_fields' to your Gemfile and run bundle install.

Use

Your model must have a text column defined.

class Address < ActiveRecord::Base
  translates :country
end

You then assign a translation key for your instances.

address = Address.new(:country => :france)
puts address.country 
# => This is the same as calling I18n.translate(:'models.address.attributes.country.france')

Compatibility

  • ruby 1.9.2
  • rails 3+