This post is old, so itβs a little updated for future readers. Instead of executing to_s, which works, you can simply interpolate the strings. It is also faster and more efficient.
x = 0.005
"With string interpolation: #{x}"
"Standard to_s method: " + x.to_s
You can also do directly (tho admittedly stupid):
"string interpolation: #{0.005}"
- Rails, , ActiveRecord. .to_s , model.value model.value.to_s.