Git Product home page Git Product logo

rails-national-parks's Introduction

National Parks

The National Park Service was created in 1916 by President Woodrow Wilson in order to preserve America's natural and historic scenery. The NPS oversees over 400 units of preserves, monuments, battlefields, and parks. 59 of these units are officially designated as National Parks.

Let's create an app to showcase these wonderful parks.

##Getting Started

  • Fork and clone this repository
  • Follow the recommended process for creating your Rails app.

##Components

Models

  • A Park model that stores the following attributes. Choose the appropriate data types for each (string or text)
    • name
    • description
    • picture (for now, have this store a URL to a picture of a park)

Controllers

  • A controller for your home page
  • A controller for your Park model

Routes and Views

| route | description | controller | action/view | |-------|-----|----|-----|------| | GET / | Your home page | home | index | | GET /parks | list all parks | parks | index | | GET /parks/new | show add park form | parks | new | | POST /parks | create park | parks | create (no view) | | GET /parks/1 | list park (id=1) | parks | show | | GET /parks/2/edit | show edit park form (id=2) | parks | edit | | PUT /parks/3 | update an existing park (id=3) | parks | update (no view) | | DELETE /parks/3 | delete an existing park (id=3) | parks | destroy (no view) |

Remember: you can list all routes by running rake routes at the command line.

##Recommended Process

###Create basic app

  • Fork and clone this repo
  • cd into the directory
  • Create app rails new ./ -T -d postgresql
  • Create database rake db:create
  • Test app
    • Run server rails s

###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...
      • Park.all
      • Park.create
      • Park.new
      • Park.find
  • Create functionality
    • Add routes to routes.rb. Use resources to create a set of RESTful CRUD routes
    • Add controllers, actions, and views where appropriate
    • Add functionality for each controller action
    • Test as needed

Styling

  • Style the pages. Play around with adding a navigation bar or carousels.
  • If using Bootstrap, use the Bootstrap form helper. Makes Bootstrap forms easily.

Bonuses


Licensing

  1. All content is licensed under a CC-BY-NC-SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].

rails-national-parks's People

Contributors

bhague1281 avatar kendradalley avatar

Watchers

James Cloos 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.