r/learnruby • • Apr 07 '17

Simple question about symbol syntax

I'm having some trouble understanding this statement I'm somewhat familiar with ruby but symbols still trip me up sometimes especially when used within hashes and all the different ways to write out hashes with symbols.

validates :content, length: { maximum: 140 }

now my question is what exactly is the length: { maxiumum: 140 } doing? is it passing a length symbol with some parameter?

2 Upvotes

3 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Apr 08 '17

Hey thank you for such a detailed response it's crystal clear now. You should consider writing guides or something man made it very understandable.

2

u/pat_trick Intermediate Apr 08 '17

No problem! I'm a Rails developer by trade, so the ecosystem is familiar to me.