Chapter 5 Helpers and Finders
In the last chapter, we identified how to configure settings in Sinatra in different environments and finished by deploying our site live on the Heroku platform. In this chapter, we’ll learn about using helper methods to make our code easier to read and less repetitive.
We’ll also look at using external gems to add extra functionality to our application. In particular, we’ll use the Sinatra::Flash gem to provide feedback messages after redirects, and the Pony gem to help send an email from our application’s contact page.
To finish off, we’ll build our own extension that uses the login functionality from the previous chapter to protect certain pages of our application.
Helper Methods
Helper methods
Get Jump Start Sinatra 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.