Today I Learned

A Hashrocket project

Ready to join Hashrocket? Find Openings here and apply today.

Pluck jsonb fields in Rails

If you have a jsonb field and you want to make a query to only return some nested value, you can use pluck:


=> ["rowing", "running"]
Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.