O'Reilly logo

Learning Sinatra by Manoj Sehrawat, Sudeep Agarwal

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

Writing routes for the responsibilities of the application

So our next step will be defining the valid routes for our application. Let's discuss the responsibilities of our application:

  • Showing a page for all the existing lists
  • Showing a page to create a new list
  • Saving a new list
  • Deleting a list
  • Showing a page to edit a list
  • Updating a list
  • Changing permissions on a list

Let's write the routes for each of these responsibilities in the following sections.

Showing a page for all the existing lists

This will load all the available lists from the database and a page that will show them. The route is defined by setting the URL path and defining the processing code. For example, in http://www.example.com/test/, the URL path is '/test/'; similarly, in http://www.example.com ...

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