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
- if flash[:notice] | |
= content_tag(:div, class: ["alert", "alert-info", "alert-dismissible"], role: "alert", id: "notice") do | |
= content_tag(:button, class: "close", type: "button", "data-dismiss"=> "alert") do | |
= content_tag(:span, escape_once("×"), "aria-hidden"=> "true") | |
= content_tag(:span, "Close", class: "sr-only") | |
= flash[:notice] |
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
print "the first number: " | |
a = gets.chomp | |
print "operator: " | |
operator = gets.chomp | |
print "the second number: " | |
b = gets.chomp | |
answer = case operator.ord | |
when 43 then a.to_i + b.to_i | |
when 45 then a.to_i - b.to_i |
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
lesson 2 Quiz | |
1. Name all the 7 or 8 routes exposed by the resources keyword in the routes.rb file. Also name the 4 named routes, and how the request is routed to the controller/action. | |
name_routes action | |
GET posts_path posts#index | |
GET post_path posts#show | |
GET new_post_path posts#new | |
POST posts#create |
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
1. why do they call it a relational database? | |
because they have join and association between tables. | |
(solution: because the tables within the database are associated with each other. This association can be created with primary and foreign keys and various syntax.) | |
2. what is SQL? | |
language used in all database systems | |
(solution: SQL stands for "structured query language" and it is used to manage operations of a relational database.) |
NewerOlder