Rails Fundamentals: Models and the to_s Method
This short post demonstrates the utility of overriding your Rails models’ to_s
method if you find yourself repeatedly outputting a specific model attribute (or outputting a compound attribute).
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
This short post demonstrates the utility of overriding your Rails models’ to_s
method if you find yourself repeatedly outputting a specific model attribute (or outputting a compound attribute).
Post a comment