Read more

Updated: assignable_values can now humanize any given value, even if it's not the current attribute

Henning Koch
July 31, 2012Software engineer at makandra GmbH

You've always been able to access the humanized version for the current value like this:

song = Song.new(:genre => 'pop')
song.humanized_genre # => 'Pop music'
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

You can now also retrieve the humanized version of any given value by passing it as an argument:

song.humanized_genre('rock') # => 'Rock music'
Posted by Henning Koch to makandra dev (2012-07-31 12:45)