Giter VIP home page Giter VIP logo

rails-api-quiz's Introduction

Rails API Quiz

Using whatever resources you like (e.g., Google, Stack Overflow, lectures, labs, notes, etc.), answer the following questions.

  1. Write the command to create a new Rails application in API mode with a Postgresql database.
  1. What are 5 other options that can be passed in to the rails new command and what do they do?
  1. What one line of code can be put into routes.rb to get all the RESTful routes for a given resource (e.g., dogs)?
  1. In the context of API development, what is versioning? How do we implement versioning in a Rails API?
  1. What is serialization in reference to a Rails API?
  1. Imagine a dog walking domain in which a walker has many dogs. Write the index action from the WalkersController. Remember, your endpoint should return JSON.
  1. Change the code from the question above so that the walkers' dogs get embedded in the JSON being returned from the index endpoint.
  1. Again, change the code above to exclude the timestamps from the data being returned in the JSON.
  1. What does CORS mean? Why do we have to think about it when making an API?
  1. What changes do we have to make in our application to allow CORS?
  1. In our dog walking app, what needs to be added to the following class to allow method calls like Dog.create(name: "Neikko", breed: "mostly rat", age: 13) and Dog.find_by(name: "Neikko") to function properly?
class Dog < ApplicationRecord
end

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.