Sometimes, ActiveRecord queries can get pretty complex, especially if you’re implementing a feature like search over a typical “index” page that also has pagination and the term itself is optional. Fortunately, ActiveRecord queries can be chained in a few ways to make this a little bit nicer. The most common is like: user=User.where(name: 'Nick Charlton').limit(1) Which you’ll see often. But you can also do something like this, which works really well for more complex queries: user=Us...