Giter Club home page Giter Club logo

checkpoint-05's Introduction

Checkpoint 05: MVC & Rails

Set Up

Fork then clone this repository. Submissions will be made by pull request.

Section I (Models & Migrations)

Commit once after completing each step.

  1. From the command line, create a new Rails application called todo_app that uses a PostgreSQL database.
  2. From the command line, create your database then generate a Todo model. Todo should have two attributes: content (string) and is_completed (boolean).
  3. From the command line, run the appropriate rails command to generate your schema.
  4. Create two Todo instances in your seed file, then run your seed file from the command line.

Section II (Routes, Controllers & Views)

Start your Rails server to see your application in the browser. Commit once after completing each action or view.

  1. Set up routes and controller actions for index, new, and create.
  2. Create views for the index and new actions.
  3. Set the homepage or root route of your application to load the Todo index view.
  4. Bonus: Your controller uses strong params.
  5. Bonus: Set up routes and controller actions for delete, edit, and update.
  6. Bonus: Create a view for edit where you can trigger an update or delete.

Plagiarism

Take a moment to re-familiarize yourself with the plagiarism policy, specifically on using work you find online and on work you do with other students.

Grading

Your score will be calculated on the following list of completed items (pulled from above). Each item is worth 1 point.

  • Your PR contains a folder called todo_app with a rails app inside of it
  • Your app is using PostgreSQL
  • You have a Todo model
  • Your Todo model has content (string) and is_completed (boolean) attributes
  • You have a valid schema
  • We can successfully create a database by running rails db:create
  • You have a seed file with two Todo instances in it
  • We can seed the database with your seed instances by running rails db:seed
  • If we run rails routes, we can see routes listed for index, new, and create
  • Your controller has index, new, and create actions
  • Your index action gets all to dos from the database and lists them in the index view
  • Your new action creates a new to do and renders a new view with a form for creating a new to do
  • Your create action creates a new to do based on a form submission and saves it to the database
  • The homepage of your app lists all to dos
  • Your git history shows that you committed your work once after each step and each commit has a descriptive message

checkpoint-05's People

Watchers

 avatar  avatar  avatar

checkpoint-05's Issues

Checkpoint 5 feedback

Part 1 (Initial Setup)

  1. Run the command to generate a new Rails application called todo_app.
    ๐Ÿ‘
  2. Create your database.
    ๐Ÿ‘
  3. Define a Todo model and create a corresponding migration. It should have two attributes: content (string) and is_completed (boolean).
    ๐Ÿ‘๐Ÿ‘
  4. Generate your schema.
    ๐Ÿ‘
  5. Create two Todo instances in your seed file. Run your seed file.
    Be careful about types; is_completed needs to be boolean and the seeds use string "No"
  6. Run your Rails server to see your application in the browser.
    ๐Ÿ‘

Part 2 (Error Driven Development)

  1. Set up routes for index, show and new.
    ๐Ÿ‘ using resources works here but make sure you know the syntax for declaring individual routes
  2. Implement controller actions and views for the index, show and new features.
    Make sure resource controllers have plural names (todos_controller.rb rather than todo_controller.rb). Also make sure to keep in mind the differences between new and create actions. The new action takes care of rendering the form for creating an entity (handles the GET /todos/new route) rather than doing the actual creation (the POST /todos route)

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.