- * * * * *
- * * Setup first Controller
Go to http://getbootstrap.com and download the dist folder.
- Navigate to the
dist/css/bootstrap.min.cssfile. - Copy and paste it into your app folder under
/public/stylesheets/bootstrap.min.css.
Let's create our own responsive grid example. Go to the index
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 'sinatra' | |
| require 'sinatra/reloader' | |
| get "/:operator/*" do | |
| operator = params[:operator].to_s | |
| n = params[:splat][0].split('/') | |
| n.map!{ |e| e.to_f } | |
| case operator | |
| when "add" |
###Quick review:
- What's an object, what's a class?
Classes are a little bit like templates. Usually, you create an instance of a class - an object. Object methods get the job done, for example blend a smoothie.
Sometimes classes have methods too, that means classes can do things without the need to create an object. But for sake of simplicity, let's say we always want to create an instance of a class, an object.
##BDD - Behavior Driven Development #Learing Objectives:
- Understand how to make list of attributes and behaviors
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
| # Classes and Objects | |
| ## Code Along | |
| require 'pry' | |
| story_hash = { | |
| "question" => "Welcome to the haunted hotel. What room would you like to go into?", | |
| "room 1" => "you're dead", | |
| "room 2" => { "question" => "You picked a good room. What would like to do?", | |
| "sleep" => "You're rested for the morning", |
NewerOlder