Giter Site home page Giter Site logo

shalstein / return-string-data-lab-v-000 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-students/return-string-data-lab-v-000

0.0 3.0 0.0 143 KB

License: Other

Ruby 78.47% JavaScript 1.49% CoffeeScript 0.95% CSS 2.35% HTML 16.75%

return-string-data-lab-v-000's Introduction

Returning Strings Lab

Objectives

  1. Return a string from a route.
  2. Use that string and replace the inner HTML of a div.

Introduction

Included in the lab is a simple Order/Invoice/Customer application. We're going to use what we've learned so far to add API endpoints and use AJAX to bring data to the page.

Instructions

  1. Add a product description and an inventory count to the Product model.
  2. Create an index page for all products that displays name and a truncated description, but not inventory.
  3. Create the new product page so you can add new products, otherwise the rest of this might be kind of underwhelming!
  4. Add a route and action that gets just a product description as a plain string.
  5. Add another route and action that checks if inventory is available. This route should return just "true" or "false" as strings.
  6. Add a "More Info" button to each product that, when clicked, fetches the description and the inventory and displays the result. If there is inventory available, display "Available" and if there isn't, display "Sold Out".
  7. Make sure tests pass!

Note: You will need to have Firefox installed for the feature specs, which use the selenium-webdriver gem to test pages with JavaScript requirements.

return-string-data-lab-v-000's People

Contributors

cernanb avatar jilustrisimo avatar pletcher avatar scottcreynolds avatar shalstein avatar

Watchers

 avatar  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.