Skip to content

Commit 45c868f

Browse files
committed
Finish layout and routes
1 parent bedccd4 commit 45c868f

File tree

18 files changed

+244
-15
lines changed

18 files changed

+244
-15
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
44
ruby "3.1.1"
55

66
gem "rails", "7.0.2.3"
7+
gem "bootstrap-sass", "3.4.1"
78
gem "sassc-rails", "2.1.2"
89
gem "sprockets-rails", "3.4.2"
910
gem "importmap-rails", "1.0.3"

Gemfile.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,14 @@ GEM
6969
addressable (2.8.0)
7070
public_suffix (>= 2.0.2, < 5.0)
7171
ansi (1.5.0)
72+
autoprefixer-rails (10.4.2.0)
73+
execjs (~> 2)
7274
bindex (0.8.1)
7375
bootsnap (1.11.1)
7476
msgpack (~> 1.2)
77+
bootstrap-sass (3.4.1)
78+
autoprefixer-rails (>= 5.2.1)
79+
sassc (>= 2.0.0)
7580
builder (3.2.4)
7681
capybara (3.36.0)
7782
addressable
@@ -91,6 +96,7 @@ GEM
9196
reline (>= 0.2.7)
9297
digest (3.1.0)
9398
erubi (1.10.0)
99+
execjs (2.8.1)
94100
ffi (1.15.5)
95101
formatador (1.1.0)
96102
globalid (1.0.0)
@@ -264,6 +270,7 @@ PLATFORMS
264270

265271
DEPENDENCIES
266272
bootsnap (= 1.11.1)
273+
bootstrap-sass (= 3.4.1)
267274
capybara (= 3.36.0)
268275
debug (= 1.4.0)
269276
guard (= 2.18.0)

app/assets/images/rails.svg

Lines changed: 35 additions & 0 deletions
Loading

app/assets/stylesheets/custom.scss

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
@import "bootstrap-sprockets";
2+
@import "bootstrap";
3+
4+
/* mixins, variables, etc. */
5+
6+
$gray-medium-light: #eaeaea;
7+
8+
/* universal */
9+
10+
body {
11+
padding-top: 60px;
12+
}
13+
14+
section {
15+
overflow: auto;
16+
}
17+
18+
textarea {
19+
resize: vertical;
20+
}
21+
22+
.center {
23+
text-align: center;
24+
h1 {
25+
margin-bottom: 10px;
26+
}
27+
}
28+
29+
/* typography */
30+
31+
h1, h2, h3, h4, h5, h6 {
32+
line-height: 1;
33+
}
34+
35+
h1 {
36+
font-size: 3em;
37+
letter-spacing: -2px;
38+
margin-bottom: 30px;
39+
text-align: center;
40+
}
41+
42+
h2 {
43+
font-size: 1.2em;
44+
letter-spacing: -1px;
45+
margin-bottom: 30px;
46+
text-align: center;
47+
font-weight: normal;
48+
color: $gray-light;
49+
}
50+
51+
p {
52+
font-size: 1.1em;
53+
line-height: 1.7em;
54+
}
55+
56+
57+
/* header */
58+
59+
#logo {
60+
float: left;
61+
margin-right: 10px;
62+
font-size: 1.7em;
63+
color: white;
64+
text-transform: uppercase;
65+
letter-spacing: -1px;
66+
padding-top: 9px;
67+
font-weight: bold;
68+
&:hover {
69+
color: white;
70+
text-decoration: none;
71+
}
72+
}
73+
74+
/* footer */
75+
76+
footer {
77+
margin-top: 45px;
78+
padding-top: 5px;
79+
border-top: 1px solid $gray-medium-light;
80+
color: $gray-light;
81+
a {
82+
color: $gray;
83+
&:hover {
84+
color: $gray-darker;
85+
}
86+
}
87+
small {
88+
float: left;
89+
}
90+
ul {
91+
float: right;
92+
list-style: none;
93+
li {
94+
float: left;
95+
margin-left: 15px;
96+
}
97+
}
98+
}

app/controllers/static_pages_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ def help
77

88
def about
99
end
10+
11+
def contact
12+
end
1013
end

app/controllers/users_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class UsersController < ApplicationController
2+
def new
3+
end
4+
end

app/helpers/users_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module UsersHelper
2+
end

app/views/layouts/_footer.html.erb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<footer class="footer">
2+
<small>
3+
The <a href="https://www.railstutorial.org/">Ruby on Rails Tutorial</a>
4+
by <a href="https://www.michaelhartl.com/">Michael Hartl</a>
5+
</small>
6+
<nav>
7+
<ul>
8+
<li><%= link_to "About", about_path %></li>
9+
<li><%= link_to "Contact", contact_path %></li>
10+
<li><a href="https://news.railstutorial.org/">News</a></li>
11+
</ul>
12+
</nav>
13+
</footer>

app/views/layouts/_header.html.erb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<header class="navbar navbar-fixed-top navbar-inverse">
2+
<div class="container">
3+
<%= link_to "sample app", root_path, id: "logo" %>
4+
<nav>
5+
<ul class="nav navbar-nav navbar-right">
6+
<li><%= link_to "Home", root_path %></li>
7+
<li><%= link_to "Help", help_path %></li>
8+
<li><%= link_to "Log in", '#' %></li>
9+
</ul>
10+
</nav>
11+
</div>
12+
</header>

app/views/layouts/_shim.html.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!--[if lt IE 9]>
2+
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.min.js">
3+
</script>
4+
<![endif]-->

0 commit comments

Comments
 (0)