Giter Club home page Giter Club logo

puppies's Introduction

README

Goal:

Goal is to build a sample Ruby on Rails application that mimics pieces of the environment.
We’ll be building an app that tracks dogs and when they were fed. This app will allow a user to manage Owners,
their Dogs and when that dog was fed. It will also allow a user to create a report of Owners/Dogs and Dog/Meals
so we can see all the owners in our system and when each dog was fed.

Requirements:

Ruby on Rails v:4.x+
MySQL – version your choice
GitHub
Must run locally (localhost:xxxx via webrick/unicorn etc.. not a 3rd party service like Heroku)

Direction:

Build three models called “owner”, “dogs” and “meals”.

  • “owner” will consist of “first_name”, “last_name”, “email” and “phone_number” (an owner can have multiple dogs) Email must be unique.
  • “dogs” is a child of “owner” and consists of “name”, “age”, “color” and “weight” (dogs can have multiple meals)
  • “meals” is a child of “dog” and represents when each dog was fed. It should contain “brand”, “quantity”, “finished” (T/F), and “finished_on” (timestamp) for when the dog was fed.

Build two view groups:

Group 1 routed to /admin\ A view which allows a user to add/edit/delete an “owner” A view which allows a user to add/edit/delete a “dog” and select it’s owner A view which allows a user add/edit/delete a “meal” associated with a dog

Group 2 routed to /reports

A view which lists dogs grouped by owner and some method to sort (developer choice)
Ability to click on a single dog and view all the meals that dog has been fed (sorted by most recent first). All the meal details should be visible and     meals that are not “finished” should be denoted in the list. 

Running the App

make sure you are in the director for the Rails app cd puppies bundle to get all the gems bundle install create the Postgres database (you should have Postgres installed from the Day 1 setup steps) rails db:create run migrations rails db:migrate seed data rails db:seed run the Rails server rails s confirm the app is serving http://localhost:3000/ Helpful Commands

rails new puppies
cd puppies
create a new resource:

rails g resource owner first_name last_name email phone_number:integer
rails g resource dog owner:belongs_to name age:integer color weight:float
rails g resource meal dog:belongs_to brand quantity:float finished:boolean finished_on:timestamps

Instructions

clone the repository
cd to puppies
bundle install
rails db:drop
rails db:create
rails db:migrate
rails db:seed
rails s
http://localhost:3000/reports/owners \

http://localhost:3000/reports/dogs/#id to see dog report\

http://localhost:3000/reports/dogs

puppies's People

Contributors

sekoudosso82 avatar

Stargazers

 avatar

Watchers

 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.