forked from codecurious-bln/basic-curriculum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwordpress-step-3.html
46 lines (43 loc) · 2.72 KB
/
wordpress-step-3.html
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<h2><span style="color: #b33605;">Step 3: Design</span></h2>
<span style="color: #b33605;"><strong>Coach: Talk about the relationship of HTML and Rails;
what part of views is HTML and what is Embedded Ruby (ERB)?
How does this relate to MVC (models and controllers control the logic of dynamically generating HTML, or views)? Explain how the app folders are ordered/classified.</strong></span>
Design doesn’t look nice. Let’s do something about it. We’ll use<strong> Twitter’s Bootstrap</strong> project to give us nicer default styles really easily.
Open <strong>app/views/layouts/application.html.erb</strong> and add on top of
<pre class="brush:css"><%= stylesheet_link_tag "application" %></pre>
the line
<pre class="brush:css"><%= stylesheet_link_tag "http://railsgirls.com/assets/bootstrap.css" %></pre>
and swap
<pre class="brush:css"><%= yield %></pre>
for
<pre class="brush:xml"><div class="container"><%= yield %></div></pre>
Let’s also add topbar and footer to the layout and style those and the attendees table. To the <strong>application.html.erb</strong> under <strong><body></strong> add:
<pre class="brush:xml"><div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container"><a class="brand" href="/">The workshop app</a><ul class="nav">
<li class="active"><a href="/attendees">attendees</a></li>
</ul>
</div>
</div>
</div></pre>
and before <strong></body></strong> add:
<pre class="brush:xml"><footer>
<div class="container">Rails Girls 2013</div>
</footer></pre>
Open <strong>app/assets/stylesheets/application.css</strong> and add to the bottom:
<pre class="brush:css">#logo {
font-size: 20px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
float: left;
padding: 10px;
}
body { padding-top: 100px; }
footer { margin-top: 100px; }
table, td, th { vertical-align: middle !important; border: none !important; }
#map { width: 800px; height: 400px; margin: 30px; }
th { border-bottom: 1px solid #DDD !important; }
td.picture { width: 140px; }
td.picture img { width: 140px; }</pre>
<strong style="color: #b33605;">Coach: Talk a little about CSS and layouts.</strong>
<h2 style="text-align: center;"><strong><a href="/apptutorial/rails-girls-app-tutorial-step-3/rails-girls-app-tutorial-step-2/"> < Step 2</a><span style="color: #d33605;">
</span></strong><a style="text-align: right;" href="/apptutorial/rails-girls-app-tutorial-step-3/rails-girls-app-tutorial-step-4/"><strong><span style="color: #d33605;">Step 4 ></span></strong></a></h2>