TEKNIK INFORMATIKA-UNIV.NASIONAL
Oleh:
Slamet nurhadi
083112706450100
UNIVERSITAS NASIONAL
DAFTAR ISI:
>ruby script/server
development:
adapter: mysql
encoding: utf8
reconnect: false
database: railscoders_development
pool: 5
username: root
password:
host: localhost
>rails tea
Lalu tekan enter, kemudian masuk ke foler tea
def about
end
def help
end
end
tea>ruby script/server
Halaman index
Buka config/routes.rb lalu ubah sehingga sebagai berikut
Dari
# map.connect ", :controller => "welcome"
Menjadi
map.connect ", :controller => "site"
Menambahkan navigasi
buka app/controllers/site controller.rb lalu ketik sehingga sebagai
berikut
def about
@title ="about Faculty"
end
def help
@title ="Help Faculty"
end
end
body {
font-family: sans-serif;
background: #0F5979;
margin: 0;
text-align: center;
}
#whole_page {
width: 50em;
margin: auto;
padding: 0;
text-align: left;
border-width: 0 1px 1px 1px;
border-color: black;
border-style: solid;
}
#header {
color: white;
background: #44960C; /* No "ruby" defined in HTML color
names! */
font-size: 24pt;
padding: 0.25em;
margin-bottom: 0;
}
#nav {
color: black;
font-size: 12pt;
font-weight: bold;
background: #ccc;
padding: 0.5em;
}
#content {
height: 100%;
background: white;
padding: 1em;
}
#content h1 {
font-size: 18pt;
}