Giter Club home page Giter Club logo

bog_app_lab's Introduction

A "Bog" Adventure App - Intro to Rails

background
A bog is a mire that accumulates peat, a deposit of dead plant material—often mosses.

Researchers at your local biology lab are exploring and documenting a series of bogs, and the creatures of interest. Our job is to encourage people in the community to explore the bogs and submit their findings using our web application.

We'll be creating a single model app to demonstrate editing resources. It's important to get comfortable with the process of starting a new Rails app since you'll be doing that for quite awhile

##Components

Bog Model

  • A creature model that stores name and description

Bog Controller

  • A controller for your home page
  • A controller that manages bog creature

Bog Routes / Views

route description controller action/view bonus?
GET / Your home page home index no.
GET /creatures list all creatures creatures index no.
GET /creatures/new show add creature form creatures new no.
POST /creatures create creature creatures create (no view) no.
GET /creatures/1 list creature creatures show (id=1)
GET /creatures/2/edit show edit creature form (id=2) creatures edit bonus
PUT /creatures/3 update an existing creature (id=3) creatures update bonus

##Recommended Process

###Create basic app

  • Fork / clone
  • cd into directory
  • Create app rails new ./ -T
  • Test app
    • Run server rails s
    • Goto localhost:3000

###Build specific functionality

  • Create model rails g model ... (you write the rest of this command)
  • Migrate rake db:migrate
  • Test models
    • run console rails c
    • Try some stuff...
      • Creature.all
      • Creature.create
      • Createre.new
      • Creature.find
      • ...etc ...etc
  • Close console run rails s
  • Create routes...
    • Add route to routes.rb
    • Add controller / action
    • Add view
    • Test (go to url in browser)
    • Repeat for each view
  • Add HTML to each view
    • Use bootstrap
    • Make it pretty... oh so pretty!!!
  • Add code to make the app functional

Bonus

  • Make a navigation bar
  • Make an edit form to edit an existing Creature
  • Make a delete button for each Creature

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.