- We both would like passing scores
- Jenny expects communication — if someone says something, don’t just acknowledge, actually say something as to why it should or shouldn’t be done that way
def translate(english_array) | |
@braille_arrays = [] | |
english_array.each do |word| | |
@characters = word.chars | |
end | |
binding.pry | |
if @characters[0].to_i.to_s == @characters[0] # checking to see if number | |
@braille_arrays << @etb_hash["#"] | |
@characters.each do |char| | |
@braille_arrays << @etb_hash[char] |
class Write | |
... | |
def translate(english_array) | |
english_array.each do |element| | |
if element.to_i.to_s == element | |
@number = Number.new(element) | |
push_one(@number.number1) | |
push_two(@number.number2) |
Purpose: To give Turing students and introduction to basic ecommerce principles so that they can develop back end systems that provide more business value.
Each number below represents a slide. The contents of the slide would be the topic and any necessary definitions. I would primarily use discussion to explain the concepts in detail.
Outline:
1) My background: started ecommerce company in 2012 and have learned from mistakes in all these areas
2) Basic rule of ecommerce: value of a customer to the business > cost of acquiring that customer
The server file accepts, parses, and controls the sending of the response. It will contain get or post etc. verb blocks based on the client's chosen path and then contain instructions for the rest of the web application to follow in collecting information from a database and then rendering that information in the context of the user's request.
- Make the variable a local variable, var. Then pass the variable as an argument into the view as a hash.
What users want | CRUD | Action (url) | Method/Verb | Data Prep | Redirect/Render | View |
---|---|---|---|---|---|---|
See all tasks | read | '/tasks' | GET | @tasks = task_manager.all | render | :index |
See one task | read | '/tasks/:id' | GET | @task = task_manager.find(id) | render | :show |
See form to input task info | create | 'tasks/new' | GET | none | render | :new |
Click Submit and save task | create | '/tasks' | POST | task_manager. create(params[:task]) | redirect | '/tasks/:id' |
See form to update task info | update | '/tasks/:id/edit' | GET | @task = task_manager.find(id) | render | :edit |
Click submit and save updated info | update | 'tasks/:id' | PUT/PATCH | task_manager.update(params[tasks].id) | redirect | '/tasks/:id' |
delete a task | delete | 'tasks/:id/delete' | DELETE | task_manager.delete(id) | redirect | '/tasks' |
Define CRUD.
- Create - tells the server to make a new instance
- Read - asks the server for information
- Update - tells the server to change something in an existing instance
- Delete - tells the server to remove something
These four functions are necessary for a complete web application.
There are seven verb + path combinations that are necessary in a basic Sinatra app in order to provide full CRUD functionality. List each of the seven combinations, and explain what each is for.
## Models, Databases, Relationships in Rails | |
#### What is the difference between a primary key and a foreign key? Where would we find a primary key? What would it be called by default? Where would we find a foreign key? What is the naming convention for a foreign key? | |
Primary key is a unique identifier in Table. It can exist as a foreign key in AnotherTable or other tables with which it has a relationship. "id" - default name. "table_id" in AnotherTable. | |
#### Write down one example of: | |
* a `one-to-one `relationship. | |
(in the contemporary West), one husband has one wife |
? => lists keyboard shortcuts available for the page | |
s => focus on the search bar (site wide) | |
g + c => go to repo home (in repositories) | |
g + p => go to open pull requests (in repositories) | |
t => activates file finder (while browsing source code) | |
l => jump to a line in code (while browsing source code) | |
w => switch to view same file in a different branch (while browsing source code) |
Scavenger Hunt
-
To concatenate files is to take the contents of several files and to insert them one after another into a different file. When rails concatenates files using sprokets, it create a unique "fingerprint" to indicate the beginning of a new file.
-
Precompilation is the process of re-coding a file into a high level language for faster processing by a client.
-
Minification is the process of removing whitespace and comments from an asset.
-
I dont know. I'm not convinced they are the same file.
-
Manifests are files that tell sprokets what to compile into its css file for the application. The manifests in catch em all are in
app/assets/javascripts/application.js
andapp/assets/stylesheets/application.css.sass