© Greg Donald 2024
G. DonaldHands-on Test-Driven Developmenthttps://doi.org/10.1007/978-1-4842-9748-3_9

9. Sidebar Contents

Greg Donald1  
(1)
Clarksville, TN, USA
 

In the previous chapter, we laid out placeholder templates for our overall application layout and our sidebar. In this chapter, we will build out a search service which will allow us to search our blog pages by keyword. We’ll also work up some clever SQL to establish our dynamically generated archive list.

Search As a Service

We’ll start this chapter by first building a search service. Our search service will be a simple Ruby class that handles searching our page records and will live in between our Search controller and our Page model. We’re going to develop it as a service because it’s ...

Get Hands-on Test-Driven Development: Using Ruby, Ruby on Rails, and RSpec now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.