Giter Club home page Giter Club logo

practice-rails's Introduction

README

Deployment

Deployment at Heroku


  • Needs the pg gem as heroku uses PostgreSQL
  • Install heroku cli
  • from command line, run heroku login -i, enter email and then enter authorization token (found at Account settings -> Applications) as password

Database


  • for dev and test & env, sqlite3 database and for prod, prostgresql is used (see config/database.yml)

Rails Commands


  • to create scffolded model: rails generate scaffold <Model name in plural form> <attr1:data_type> <attr2:data_type>...<attrn, data_type>
  • open console: rails console

Following the tab;e

Full Command Shortcut
$ rails server $ rails s
$ rails console $ rails c
$ rails generate $ rails g
$ rails test $ rails t
$ bundle install $ bundle
  • Creating controller, e.g rails generate controller StaticPages home help, where StaticPages is the controller and home and help are action methods
  • Creating model, e.g rails generate model User name:string email:string, where User is the model and name, email are the attributes
  • Destroy controller/model, e.g rails destroy controller StaticPages home help/ rails destroy model User
  • DB migration, e.g rails db:migrate
  • We can undo a single migration step using, rails db:rollback
  • To go all the way back to the beginning, we can use, rails db:migrate VERSION=0

Project Setup to Run with Cloud based IDE


  • If the ruby version is <3.0.0, update ruby with rbenv
  • From command line, run, bin/rails server

practice-rails's People

Contributors

ririyad avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

practice-rails's Issues

Notes For Next: 01

  • Re-visit the rails commands from README
  • Test Driven Development: RED, GREEN, REFACTOR
  • minitest gem has been added for better test result view

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.