Giter VIP home page Giter VIP logo

checkpoint-rails's Introduction

Rails Checkpoint

Instructions

Fork and clone this repository and follow the instructions below. Make at least one commit for each section. When finished, push your commits to your forked repository and submit a Pull Request back to the original repository.

Section I (Models & Migrations)

Note: This repo already contains an empty rails app.

  1. In the terminal run the command to create your database.
  2. Create two models for Post and Comment where comments are owned by posts.
  3. Database table for Post should have two attributes: content (string) and is_published (boolean) and table for Comment should have an attribute body (string).
  4. From the command line, run the appropriate rails command to generate your schema.
  5. Create two Post instances in your seed file, then run your seed file from the command line.

Section II (Routes, Controllers & Views)

Remember to start your Rails server to inspect your application in the browser.

  1. Set up routes and controller actions for the index, show, new, and create for the Post model only. (Note: only use instance variables @posts and @post for sending data to the view)
  2. Create views for the index, show and new actions. (Note: index and show views MUST render the post('s) content property, and the new view must have a namespaced form field for content)

Test Your Code Early. Test Your Code Often

Before you begin, run the test suite (instructions below) to see all the checks that will be run against your work.

Pay close attention to lines showing Error - uninitialized constant NAME. This tells you a file hasn't been created or the contents haven't been defined properly. There are tests waiting to run which can't proceed until you set up those files.

Your job is to get the results showing 0 failures, and have no lines showing Error - uninitialized constant

Once you think you've satisfied one of the above steps, run the test suite to double-check your work.

To run the tests, first ensure all gems from the Gemfile are installed:

bundle install

Then call the test runner each time you want to check your code.

For Section I only

rspec --format documentation spec/models_migrations_spec.rb

For Section II only

rspec --format documentation spec/routes_controllers_views_spec.rb

Display test results for both sections at Once

rspec --format documentation

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.