Building a Sinatra CRUD App

Where do I begin with this extensive yet simple project? Migrations, Views and Models, oh my! The smartest thing when building an app that requires migrations is having your files organized, named correctly and having a gameplan to work off of.

I found it very easy to set a task, accomplish it and move on to the next requirement, rather than going into it freely without a goal in sight. As you build your application, you find that there are easier ways to achieve a task, and most of the time having the same code repeated.

Welcome to the private Method.

Rather than using the same code multiple times throughout your class. This private method gives the engineer the ability to take their repeated code, insert into a new defined method, and call it anywhere in their class. Aesthetically it is a great way to reduce clutter, and can help you to shorten code as well.


Using Rack::MethodOverride is always a must when building a CRUD app. Without this, we would not be able to make patch/put requests and also would not be able to edit or delete. We use this when we’re creating a form using HTTP. HTTP can only receive a post or get requests, so using Rack::MethodOverride helps you override post request and allows you to set a value that is equal to a patch which holds your edit and delete methods.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store