-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuiz: Lesson 3
30 lines (18 loc) · 1.51 KB
/
Quiz: Lesson 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Quiz: Lesson 3
1. HTML: Hypertext Markup Language is the structure or skeleton of the web page.
CSS: Cascading Style Sheet controls the look/style of the web page.
Javascript: Makes the web page interactive.
2. HTTP request contains a verb (i.e. GET), URL and parameters
3. HTTP response contains status code and a payload.
4. <form action='/' method='post'>
<input type='submit' name='username'/>
</form>
5. Because to developer needs to reconstitute the state every time to make the user experience persistent. the developer needs to use a persistence storage (database, caches).
6. Because the user doesn't need to see everything that is going on with HTTP. We could just use a console like terminal (curl).
7. MVC is a pattern of organising code. It stands for Model View Controller. It is important because it separates the different components of an app, such as front-end, back-end, http.
SINATRA
1. Requests are processed by route methods where templates are rendered or redirected. Instance variables or session variables can be used to make the html dynamic.
2. The response of a render is status code 200 where html is sent as a response payload. The response of a redirect is a GET request to another URL.
3. We use <%= %> or <% %> tags together with instance variables, session variables or helper methods within the HTML to show dynamic content.
4. ERB template is turned into HTML before it is sent as a response on every request.
5. Instance variables set in main.rb allow view templates to access them.