Giter Club home page Giter Club logo

myrails's Introduction

README

This README would normally document whatever steps are necessary to get the application up and running.

Things you may want to cover:

  • Ruby version

  • System dependencies

  • Configuration

  • Database creation

  • Database initialization

  • How to run the test suite

  • Services (job queues, cache servers, search engines, etc.)

  • Deployment instructions

  • ...

Full command Shortcut $ rails server $ rails s $ rails console $ rails c $ rails generate $ rails g $ rails test $ rails t $ bundle install $ bundle

  • note that we have passed the controller name as CamelCase (so called because it resembles the humps of a Bactrian camel), which leads to the creation of a controller file written in snake case, so that a controller called StaticPages yields a file called static_pages_controller.rb.
  • About page titles have a variable component, we’ll use a special Rails function called provide to set a different title on each page.
  • Ruby won’t interpolate into single-quoted strings
  • Everything in Ruby, including strings and even nil, is an object.
  • Note the question mark at the end of the empty? method. This is a Ruby convention indicating that the return value is boolean: true or false.
  • the nil object is special, in that it is the only Ruby object that is false in a boolean context
  • a = [42, 8, 17] a << "foo" << "bar" (0..9).to_a a[0..2]
  • (1..5).each do |number| ; 3.times { puts "Betelgeuse!" } ; (1..5).map { |i| i**2 } ; %w[A B C].map(&:downcase)
  • user = { :name => "Michael Hartl", :email => "[email protected]" }
  • attr_accessor :name, :email, creates “getter” and “setter” methods that allow us to retrieve (get) and assign (set) @name and @email instance variables

app/assets: assets specific to the present application lib/assets: assets for libraries written by your dev team vendor/assets: assets from third-party vendors

  • Active Record comes with a host of methods for creating, saving, and finding data objects, all without having to use the structured query language (SQL)2 used by relational databases.
  • Rails has a feature called migrations to allow data definitions to be written in pure Ruby, without having to learn an SQL data definition language (DDL).
  • rails console --sandbox

myrails's People

Contributors

jessie-jning avatar

Watchers

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