Giter Site home page Giter Site logo

sinatra-restful-routes-lab-immersive-alum's Introduction

Restful Routes Basic Lab

Objectives

  • Build RESTful routes to create, show, edit, and delete items from the database

Instructions

Instead of keeping all your recipes on index cards (just like your grandma did!), we're going to be building a web app to store those recipes for you!

  1. Create a new table in the database to store the recipes. Recipes should have a name, ingredients (which can be written as one string containing all the ingredients), and cook_time. These attributes should each be a string.

  2. Make sure you have a corresponding model for your recipes.

  3. In the application_controller.rb, set up a controller action that will render a form to create a new recipe. This controller action should create and save this new recipe to the database.

  4. Again in the application_controller.rb, create a controller action that uses RESTful routes to display a single recipe.

  5. Create a third controller action that uses RESTful routes and renders a form to edit a single recipe. This controller action should update the entry in the database with the changes, and then redirect to the recipe show page.

  6. Create a controller action (index action) that displays all the recipes in the database.

  7. Add to the recipe show page a form that allows a user to delete a recipe. This form should submit to a controller action that deletes the entry from the database and redirects to the index page.

sinatra-restful-routes-lab-immersive-alum's People

Contributors

victhevenot avatar maxwellbenton avatar rrcobb avatar lizbur10 avatar dependabot[bot] avatar sylwiavargas avatar ruchiramani avatar danielseehausen avatar sophiedebenedetto avatar bhollan avatar cernanb avatar pletcher avatar ihollander avatar joshuabamboo avatar rishter avatar

Watchers

 avatar Mat Balez avatar  avatar  avatar Joe Cardarelli avatar Taranjyot Singh avatar Sara Tibbetts avatar The Learn Team avatar  avatar  avatar Antoin avatar Nicole Kroese  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.