GithubHelp home page GithubHelp logo

wdi-sg / rails-national-parks-jsh Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 137 KB

rails-national-parks-jsh created by GitHub Classroom

License: Other

Ruby 74.33% JavaScript 2.97% CoffeeScript 1.04% CSS 3.06% HTML 18.59%

rails-national-parks-jsh's Introduction

National Parks

Beginning with the first Tree Planting Campaign in 1963, At National Parks Board (NParks) has come a long way in greening up our island city, with 4 nature reserves and more than 300 parks sprawled across Singapore to date and still growing.

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 rails 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 rails db:create
  • Test app
    • Run server rails s

###Build specific functionality

  • Create model rails g model ... (you write the rest of this command)
  • Migrate rails 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

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-jsh's People

Contributors

bhague1281 avatar jeremiahalex avatar johnacs avatar hsquek avatar skeerti2 avatar

Watchers

James Cloos avatar Jonathan Phoon 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.