[]=

[]=(attr_name, value)
Instance Public methods

Updates the attribute identified by attr_name with the specified value. (Alias for the protected write_attribute method).

class Person < ActiveRecord::Base
end

person = Person.new
person[:age] = '22'
person[:age] # => 22
person[:age] # => Fixnum
doc_ruby_on_rails
2015-06-20 00:00:00
Comments
Leave a Comment

Please login to continue.