O'Reilly logo

Jump Start Sinatra by Darren Jones

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required