Giter Site home page Giter Site logo

rmcneely / rails-pollywog-ranch-v-000 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-students/rails-pollywog-ranch-v-000

0.0 2.0 0.0 82 KB

License: MIT License

Ruby 75.44% JavaScript 1.18% CoffeeScript 0.38% CSS 2.92% HTML 20.09%

rails-pollywog-ranch-v-000's Introduction

tadpoles and frogs

Pollywog Ranch

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 metamorphosize 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 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, #metamorphosize, to this controller
    1. config/routes.rb
    • Here you'll allow a form to post to /tadpoles/:id/metamorphosize
    • This should route the request to the Tadpoles Controller's metamorphoize action
    1. views/tadpoles/show.html.erb
    • You'll add a form that will post to /tadpoles/:id/metamorphosize with a submit button that reads "Become a frog"
  • If you get stuck refer to Rails Active Record Documentation.

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

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 metamorphosize. Click on any tadpole and make it metamorphosize. Did the app go about metamorphosizing 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 metamorphosize into a frog, see config/routes.rb and views/frogs/show.html.erb. You can learn more about nested resources below.

Resources

View on Learn.co and start learning to code for free.

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

rails-pollywog-ranch-v-000's People

Contributors

annjohn avatar fislabstest avatar fs-lms-test-bot avatar ipc103 avatar irmiller22 avatar kthffmn avatar matthewkrey avatar pajamaw avatar pletcher avatar rmcneely avatar roseweixel avatar sarogers avatar stephaniecoleman avatar zachnewburgh 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.