Giter Site home page Giter Site logo

rails-pollywog-ranch-nyc-web-102918's Introduction

Rails Pollywog Ranch Lab

tadpoles and frogs

Goal

Help Frog Rancher Darryl categorize and track all the ponds, frogs, and tadpoles on his ranch. To do this you will create migrations and models complete with ActiveRecord associations.

Background

After speaking with Darryl, he has informed us that he has several ponds on his ranch. Each pond has different frogs that live there. Some of those frogs have tadpole babies. The frogs all have the ability to have tadpoles at any given time, and the tadpoles have the ability to metamorphose into frogs at any time.

Example

Here's a demo of what we're aiming for.

Instructions

Getting Started

  • Run bundle install then rspec to see what course to take. Keep in mind that, for the association of tadpoles belonging to a pond through a frog, you'll have to delegate.

  • Take a look at the tests in spec/models before writing your migrations.

  • Once your migrations are done, start on the associations in your models.

  • Once the associations are passing, you'll be modifying three files:

    1. app/controllers/tadpoles_controller.rb
    • You'll add an action, #metamorphose, to this controller
    1. config/routes.rb
    • Here you'll allow a form to post to /tadpoles/:id/metamorphose
    • This should route the request to the TadpolesController's #metamorphose action
    1. views/tadpoles/show.html.erb
    • You'll add a form that will post to /tadpoles/:id/metamorphose with a submit button that reads "Become a frog"
  • If you get stuck refer to the Rails Active Record documentation.

  • You can refer to this link as a quick reference for the Rails 4 folder structure.

Running the App Locally

  • When you're finished and all the specs are passing, go ahead and run the following commands from your terminal:
    • rake db:migrate
    • rake db:seed
    • rails s
  • Then hit up the app here.

Critical Thinking

  • Think about how you would get a tadpole to metamorphose. Click on any tadpole, and make it metamorphose. Did the app go about metamorphosing tadpoles in the same way you would have?
  • Think about how you would get a frog to have tadpole babies. Click on any frog, and make it have a baby. Did the app go about making baby tadpoles in the same way you would have? For more details about metamorphosing into a frog, see config/routes.rb and views/frogs/show.html.erb. You can learn more about nested resources below.

Resources

View Rails Pollywog Ranch Lab on Learn.co and start learning to code for free.

rails-pollywog-ranch-nyc-web-102918's People

Contributors

kthffmn avatar gj avatar annjohn avatar sarogers avatar pletcher avatar lukeghenco avatar fislabstest avatar kwebster2 avatar ipc103 avatar roseweixel avatar zachnewburgh avatar sgharms avatar stephaniecoleman avatar pajamaw avatar matthewkrey avatar irmiller22 avatar danielseehausen avatar fs-lms-test-bot avatar

Watchers

Kevin McAlear avatar  avatar Victoria Thevenot avatar Belinda Black avatar  avatar Joe Cardarelli avatar Sam Birk avatar Sara Tibbetts avatar  avatar Sophie DeBenedetto avatar  avatar Jaichitra (JC) Balakrishnan avatar Antoin avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Nicole Kroese  avatar  avatar Lore Dirick avatar Nicolas Marcora avatar Lisa Jiang 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.