rails new NOM_DE_L_APP
rails new NOM_DE_L_APP --webpack
rails new NOM_DE_L_APP --database=postgres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative "../models/employee" | |
require 'sqlite3' | |
class EmployeesRepository | |
def initialize | |
@db = SQLite3::Database.new('./food_delivery.sqlite3') | |
@db.results_as_hash = true | |
@employees = [] | |
load_employees_from_db | |
end |
Turbolinks is a JavaScript library that intercepts all clicks on <a>
links and makes that request via AJAX.
It then merges the <head>
and replaces the current page <body>
with the new body from the AJAX HTML response.
The promise:
- Get the performance of a single-page application without the added complexity of a client-side JavaScript framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Car # => UpperCamelCase | |
# attr_reader :color, :brand | |
# attr_writer :color | |
attr_accessor :color, :brand | |
def initialize(color, brand) # => constructor stores the data/state | |
@color = color | |
@brand = brand | |
@engine_started = false # => instance variable | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative "../citizen" | |
describe Citizen do | |
describe "can vote" do | |
it "should return true for a major citizen" do | |
citizen = Citizen.new("", "", 25) | |
expect(citizen.can_vote?).to eq(true) | |
end | |
it "should return false for a minor citizen" do |
Here is a list of guidelines you should follow during a part-time session:
This is the best way to kickstart the session and have everyone concerned and motivated.
Students should know they can report any problem to you.
Turbolinks is a JavaScript library that intercepts all clicks on <a>
links and makes that request via AJAX.
It then merges the <head>
and replaces the current page <body>
with the new body from the AJAX HTML response.
The promise:
- Get the performance of a single-page application without the added complexity of a client-side JavaScript framework