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 (or helpers, for ...