[]=

[]=(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
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.