質問編集履歴
7
崩れた箇所が変更になったのでそちらを載せました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ログイン状態とログアウト状態でレイアウトが崩れてしまう
|
1
|
+
動画投稿ページでログイン状態とログアウト状態でレイアウトが崩れてしまう
|
test
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
Railsで
|
1
|
+
Railsで動画投稿ページでサイドメニュー欄が崩れてしまいます
|
2
2
|
|
3
3
|
|
4
4
|
|
5
5
|
期待される状態
|
6
6
|
|
7
|
-
![イメージ説明](
|
7
|
+
![イメージ説明](c251914061645a2e6acdea82b762ad4f.png)
|
8
8
|
|
9
9
|
|
10
10
|
|
11
11
|
今の状態
|
12
12
|
|
13
|
-
![イメージ説明](
|
13
|
+
![イメージ説明](77461c9801ed3e882154f3110988737a.png)
|
14
|
-
|
14
|
+
|
15
|
-
これらを期待される状態に
|
15
|
+
これらを期待される状態にしたいです。
|
16
16
|
|
17
17
|
|
18
18
|
|
19
19
|
#問題のソースコード
|
20
20
|
|
21
|
-
一覧ページのHTML
|
21
|
+
動画一覧ページのHTML
|
22
22
|
|
23
23
|
|
24
24
|
|
@@ -26,548 +26,562 @@
|
|
26
26
|
|
27
27
|
<div class="content-wrapper">
|
28
28
|
|
29
|
-
<div class="content-block">
|
30
|
-
|
31
|
-
<% @
|
32
|
-
|
33
|
-
<div class="content">
|
34
|
-
|
35
|
-
<div class="user-about">
|
36
|
-
|
37
|
-
<div class="image">
|
38
|
-
|
39
|
-
<% if
|
40
|
-
|
41
|
-
<%= image_tag
|
42
|
-
|
43
|
-
<% else %>
|
44
|
-
|
45
|
-
<%= image_tag 'no.user.png' %>
|
46
|
-
|
47
|
-
<% end %>
|
48
|
-
|
49
|
-
</div>
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
<div class="profile">
|
54
|
-
|
55
|
-
<div class="name-history">
|
56
|
-
|
57
|
-
<div class="name">
|
58
|
-
|
59
|
-
<%=
|
29
|
+
<div class="content-block">
|
30
|
+
|
31
|
+
<% @movies.each do |movie| %>
|
32
|
+
|
33
|
+
<div class="content">
|
34
|
+
|
35
|
+
<div class="user-about">
|
36
|
+
|
37
|
+
<div class="image">
|
38
|
+
|
39
|
+
<% if movie.user.image.attached? %>
|
40
|
+
|
41
|
+
<%= image_tag movie.user.image %>
|
42
|
+
|
43
|
+
<% else %>
|
44
|
+
|
45
|
+
<%= image_tag 'no.user.png' %>
|
46
|
+
|
47
|
+
<% end %>
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
<div class="profile">
|
54
|
+
|
55
|
+
<div class="name-history">
|
56
|
+
|
57
|
+
<div class="name">
|
58
|
+
|
59
|
+
<%= movie.user.nickname %>
|
60
|
+
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<div class="mania-histry">
|
64
|
+
|
65
|
+
<%= "趣味歴:#{movie.user.mania_histry}年" %>
|
66
|
+
|
67
|
+
</div>
|
68
|
+
|
69
|
+
</div>
|
70
|
+
|
71
|
+
<div class="enjoy-point">
|
72
|
+
|
73
|
+
<%= "楽しいポイント#{movie.user.enjoy_point}"%>
|
74
|
+
|
75
|
+
</div>
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
</div>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<div class="text">
|
84
|
+
|
85
|
+
<h2><%= truncate(movie.title, length:15) %></h2><%= link_to "コメントor続きをよむ", "/movies/#{movie.id}" %>
|
86
|
+
|
87
|
+
<h3><%= truncate(movie.introduction, length:15) %></h3>
|
88
|
+
|
89
|
+
<video src=<%= rails_blob_path(movie.movie) %> , controls>
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<div class="action-menu">
|
96
|
+
|
97
|
+
<div id="movie_<%= movie.id %>">
|
98
|
+
|
99
|
+
<%= render 'movie', movie: movie %>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<% if user_signed_in?%>
|
104
|
+
|
105
|
+
<div class='user-action'>
|
106
|
+
|
107
|
+
<% if current_user.id == movie.user.id %>
|
108
|
+
|
109
|
+
<%= link_to "編集", edit_movie_path(movie) %>
|
110
|
+
|
111
|
+
<%= link_to "削除", movie_path(movie), method: :delete %>
|
112
|
+
|
113
|
+
<% end %>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<% end %>
|
118
|
+
|
119
|
+
</div>
|
60
120
|
|
61
121
|
</div>
|
62
122
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
</
|
70
|
-
|
71
|
-
<div
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
123
|
+
<% end %>
|
124
|
+
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<div class="sidebar">
|
128
|
+
|
129
|
+
<%= render 'shared/menu'%>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
</div>
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
```
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
動画ページのCSS
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
```CSS
|
148
|
+
|
149
|
+
// Place all the styles related to the movies controller here.
|
150
|
+
|
151
|
+
// They will automatically be included in application.css.
|
152
|
+
|
153
|
+
// You can use Sass (SCSS) here: http://sass-lang.com/
|
154
|
+
|
155
|
+
#movies-new,#movies-index{
|
156
|
+
|
157
|
+
.content-wrapper{
|
158
|
+
|
159
|
+
display: flex;
|
160
|
+
|
161
|
+
justify-content: space-between;
|
162
|
+
|
163
|
+
.content-block{
|
164
|
+
|
165
|
+
border: 2px solid #000;
|
166
|
+
|
167
|
+
padding: 20px;
|
168
|
+
|
169
|
+
width: 60%;
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
.content{
|
174
|
+
|
175
|
+
border: 2px solid #000;
|
176
|
+
|
177
|
+
padding: 15px;
|
178
|
+
|
179
|
+
margin-bottom: 10px;
|
180
|
+
|
181
|
+
.user-about{
|
182
|
+
|
183
|
+
display: flex;
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
.profile{
|
190
|
+
|
191
|
+
margin-left: 10px;
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
.name-history{
|
196
|
+
|
197
|
+
margin-bottom: 3px;
|
198
|
+
|
199
|
+
display: flex;
|
200
|
+
|
201
|
+
width: 100%;
|
202
|
+
|
203
|
+
.name{
|
204
|
+
|
205
|
+
font-weight: bold;
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
.mania-histry{
|
212
|
+
|
213
|
+
margin-left: 20px;
|
214
|
+
|
215
|
+
}
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
.enjoy-point{
|
222
|
+
|
223
|
+
width: 100%;
|
224
|
+
|
225
|
+
font-size: 13px;
|
226
|
+
|
227
|
+
}
|
228
|
+
|
229
|
+
}
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
}
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
.sidebar{
|
240
|
+
|
241
|
+
width: 20%;
|
242
|
+
|
243
|
+
border: 2px solid #000;
|
244
|
+
|
245
|
+
padding: 20px;
|
246
|
+
|
247
|
+
}
|
248
|
+
|
249
|
+
.box{
|
250
|
+
|
251
|
+
width: 100px;
|
252
|
+
|
253
|
+
height: 100px;
|
254
|
+
|
255
|
+
background-color: #000;
|
256
|
+
|
257
|
+
margin: 10px auto;
|
258
|
+
|
259
|
+
}
|
260
|
+
|
261
|
+
}
|
262
|
+
|
263
|
+
}
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
video{
|
268
|
+
|
269
|
+
max-width: 100%;
|
270
|
+
|
271
|
+
}
|
272
|
+
|
273
|
+
.text p{
|
274
|
+
|
275
|
+
margin: 0px;
|
276
|
+
|
277
|
+
}
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
.user-action{
|
282
|
+
|
283
|
+
margin-top: 18px;
|
284
|
+
|
285
|
+
}
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
#movies-show{
|
290
|
+
|
291
|
+
.content{
|
292
|
+
|
293
|
+
border: 2px solid #000;
|
294
|
+
|
295
|
+
padding: 15px;
|
296
|
+
|
297
|
+
margin-bottom: 10px;
|
298
|
+
|
299
|
+
.user-about{
|
300
|
+
|
301
|
+
display: flex;
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
.image{
|
306
|
+
|
307
|
+
width: 10%;
|
308
|
+
|
309
|
+
}
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
.profile{
|
314
|
+
|
315
|
+
margin-left: 10px;
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
.name-history{
|
320
|
+
|
321
|
+
margin-bottom: 3px;
|
322
|
+
|
323
|
+
display: flex;
|
324
|
+
|
325
|
+
width: 100%;
|
326
|
+
|
327
|
+
.name{
|
328
|
+
|
329
|
+
font-weight: bold;
|
330
|
+
|
331
|
+
}
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
.mania-histry{
|
336
|
+
|
337
|
+
margin-left: 20px;
|
338
|
+
|
339
|
+
}
|
340
|
+
|
341
|
+
}
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
.enjoy-point{
|
346
|
+
|
347
|
+
width: 100%;
|
348
|
+
|
349
|
+
font-size: 13px;
|
350
|
+
|
351
|
+
}
|
352
|
+
|
353
|
+
}
|
354
|
+
|
355
|
+
}
|
356
|
+
|
357
|
+
}
|
358
|
+
|
359
|
+
}
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
.comment-buttom{
|
364
|
+
|
365
|
+
background-color: #333;
|
366
|
+
|
367
|
+
color: #fff;
|
368
|
+
|
369
|
+
padding: 5px;
|
370
|
+
|
371
|
+
text-decoration: none;
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
}
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
h3{
|
380
|
+
|
381
|
+
margin-bottom: 9px;
|
382
|
+
|
383
|
+
}
|
384
|
+
|
385
|
+
.submit-block{
|
386
|
+
|
387
|
+
display: flex;
|
388
|
+
|
389
|
+
align-items: center;
|
390
|
+
|
391
|
+
justify-content: center;
|
392
|
+
|
393
|
+
margin: 15px 0;
|
394
|
+
|
395
|
+
.button {
|
396
|
+
|
397
|
+
display : inline-block;
|
398
|
+
|
399
|
+
border-radius : 5%; /* 角丸 */
|
400
|
+
|
401
|
+
font-size : 18pt; /* 文字サイズ */
|
402
|
+
|
403
|
+
text-align : center; /* 文字位置 */
|
404
|
+
|
405
|
+
cursor : pointer; /* カーソル */
|
406
|
+
|
407
|
+
padding : 12px 12px; /* 余白 */
|
408
|
+
|
409
|
+
background : #333; /* 背景色 */
|
410
|
+
|
411
|
+
color : #ffffff; /* 文字色 */
|
412
|
+
|
413
|
+
line-height : 1em; /* 1行の高さ */
|
414
|
+
|
415
|
+
transition : .3s; /* なめらか変化 */
|
416
|
+
|
417
|
+
box-shadow : 6px 6px 3px #666666; /* 影の設定 */
|
418
|
+
|
419
|
+
border : 2px solid #333; /* 枠の指定 */
|
420
|
+
|
421
|
+
}
|
422
|
+
|
423
|
+
.button:hover {
|
424
|
+
|
425
|
+
box-shadow : none; /* カーソル時の影消去 */
|
426
|
+
|
427
|
+
color : #333; /* 背景色 */
|
428
|
+
|
429
|
+
background : #ffffff; /* 文字色 */
|
430
|
+
|
431
|
+
}
|
432
|
+
|
433
|
+
}
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
```
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
今回崩れてしまっているサイドバーのHTML
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
```HTML
|
446
|
+
|
447
|
+
<div id="menu">
|
448
|
+
|
449
|
+
<div class="menu-link">
|
450
|
+
|
451
|
+
<ul id ='nav'>
|
452
|
+
|
453
|
+
<%if user_signed_in?%>
|
454
|
+
|
455
|
+
<li>
|
456
|
+
|
457
|
+
<%= link_to 'つぶやき投稿', new_post_path(@post) %>
|
458
|
+
|
459
|
+
</li>
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
<li>
|
464
|
+
|
465
|
+
<%= link_to 'つぶやき一覧', root_path %>
|
466
|
+
|
467
|
+
</li>
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
<li>
|
472
|
+
|
473
|
+
<%= link_to 'ログアウト', destroy_user_session_path, method: :delete %>
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
</li>
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
<li>
|
482
|
+
|
483
|
+
<%= link_to '動画投稿', new_movie_path %>
|
484
|
+
|
485
|
+
</li>
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
<li>
|
490
|
+
|
491
|
+
<%= link_to '動画一覧', movies_path %>
|
492
|
+
|
493
|
+
</li>
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
<li>
|
498
|
+
|
499
|
+
<%= link_to 'ブログ一覧', blogs_path %>
|
500
|
+
|
501
|
+
</li>
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
<li>
|
506
|
+
|
507
|
+
<%= link_to 'ブログ投稿', new_blog_path %>
|
508
|
+
|
509
|
+
</li>
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
<% else %>
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
<li>
|
518
|
+
|
519
|
+
<%= link_to 'ログイン', new_user_session_path %>
|
520
|
+
|
521
|
+
</li>
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
<li>
|
526
|
+
|
527
|
+
<%= link_to '新規登録', new_user_registration_path %>
|
528
|
+
|
529
|
+
</li>
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
<li>
|
534
|
+
|
535
|
+
<%= link_to '動画一覧', movies_path %>
|
536
|
+
|
537
|
+
</li>
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
<li>
|
542
|
+
|
543
|
+
<%= link_to 'ブログ一覧', blogs_path %>
|
544
|
+
|
545
|
+
</li>
|
546
|
+
|
547
|
+
<% end %>
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
</ul>
|
556
|
+
|
557
|
+
</div>
|
90
558
|
|
91
559
|
</div>
|
92
560
|
|
93
561
|
|
94
562
|
|
95
|
-
|
563
|
+
```
|
96
|
-
|
97
|
-
|
564
|
+
|
98
|
-
|
99
|
-
|
565
|
+
|
100
|
-
|
566
|
+
|
101
|
-
|
567
|
+
#やってみたこと
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
568
|
+
|
106
|
-
|
107
|
-
|
569
|
+
|
108
|
-
|
109
|
-
|
570
|
+
|
110
|
-
|
111
|
-
<%= link_to "編集", edit_blog_path(blog) %>
|
112
|
-
|
113
|
-
<%= link_to "削除", blog_path(blog), method: :delete %>
|
114
|
-
|
115
|
-
|
571
|
+
HTMLのcontent-blockの中に
|
116
|
-
|
117
|
-
|
572
|
+
|
118
|
-
|
573
|
+
|
574
|
+
|
119
|
-
|
575
|
+
```
|
120
|
-
|
121
|
-
|
576
|
+
|
122
|
-
|
123
|
-
</div>
|
124
|
-
|
125
|
-
<% end %>
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
577
|
+
<div class="sidebar">
|
130
|
-
|
578
|
+
|
131
|
-
|
579
|
+
<%= render 'shared/menu'%>
|
132
|
-
|
133
|
-
</div>
|
134
580
|
|
135
581
|
</div>
|
136
582
|
|
137
|
-
</div>
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
583
|
```
|
144
584
|
|
145
|
-
|
146
|
-
|
147
|
-
ブログページのCSS
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
```CSS
|
152
|
-
|
153
|
-
@import "font-awesome-sprockets";
|
154
|
-
|
155
|
-
@import "font-awesome";
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
body{
|
160
|
-
|
161
|
-
word-wrap: break-word;
|
162
|
-
|
163
|
-
max-width: 1080px;
|
164
|
-
|
165
|
-
margin: 0 auto;
|
166
|
-
|
167
|
-
}
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
img {
|
172
|
-
|
173
|
-
max-width: 100%;
|
174
|
-
|
175
|
-
}
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
.logo{
|
182
|
-
|
183
|
-
width: 140px;
|
184
|
-
|
185
|
-
text-align: center;
|
186
|
-
|
187
|
-
background-color: #333;
|
188
|
-
|
189
|
-
height: 50px;
|
190
|
-
|
191
|
-
line-height: 50px;
|
192
|
-
|
193
|
-
margin-right: 2px;
|
194
|
-
|
195
|
-
margin-bottom: 10px;
|
196
|
-
|
197
|
-
margin-top: 10px;
|
198
|
-
|
199
|
-
}
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
.logo a{
|
204
|
-
|
205
|
-
color: #fff;
|
206
|
-
|
207
|
-
text-decoration: none;
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
}
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
#menu #nav li {
|
216
|
-
|
217
|
-
list-style: none;
|
218
|
-
|
219
|
-
width: 140px;
|
220
|
-
|
221
|
-
text-align: center;
|
222
|
-
|
223
|
-
background-color: #333;
|
224
|
-
|
225
|
-
height: 50px;
|
226
|
-
|
227
|
-
line-height: 50px;
|
228
|
-
|
229
|
-
margin-right: 2px;
|
230
|
-
|
231
|
-
margin-bottom: 10px;
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
}
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
#menu #nav li a {
|
240
|
-
|
241
|
-
text-decoration: none;
|
242
|
-
|
243
|
-
color: #fff;
|
244
|
-
|
245
|
-
font-weight: bold;
|
246
|
-
|
247
|
-
padding: 20px;
|
248
|
-
|
249
|
-
}
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
#footer{
|
254
|
-
|
255
|
-
background-color: #333;
|
256
|
-
|
257
|
-
text-align: center;
|
258
|
-
|
259
|
-
color: white;
|
260
|
-
|
261
|
-
padding: 10px 0;
|
262
|
-
|
263
|
-
font-size: 13px;
|
264
|
-
|
265
|
-
margin-top: 20px;
|
266
|
-
|
267
|
-
}
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
#footer p{
|
272
|
-
|
273
|
-
margin: 0;
|
274
|
-
|
275
|
-
}
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
.toast{
|
280
|
-
|
281
|
-
margin: 10px 0;
|
282
|
-
|
283
|
-
text-align: center;
|
284
|
-
|
285
|
-
}
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
.toast .notice{
|
290
|
-
|
291
|
-
background-color: #49ac49;
|
292
|
-
|
293
|
-
color: white;
|
294
|
-
|
295
|
-
padding: 10px;
|
296
|
-
|
297
|
-
}
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
.toast .aleat{
|
302
|
-
|
303
|
-
background-color: red;
|
304
|
-
|
305
|
-
color: white;
|
306
|
-
|
307
|
-
padding: 10px;
|
308
|
-
|
309
|
-
}
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
.content-wrapper{
|
314
|
-
|
315
|
-
display: flex;
|
316
|
-
|
317
|
-
justify-content: space-between;
|
318
|
-
|
319
|
-
.content-block{
|
320
|
-
|
321
|
-
border: 2px solid #000;
|
322
|
-
|
323
|
-
padding: 20px;
|
324
|
-
|
325
|
-
width: 60%;
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
.content{
|
330
|
-
|
331
|
-
border: 2px solid #000;
|
332
|
-
|
333
|
-
padding: 15px;
|
334
|
-
|
335
|
-
margin-bottom: 10px;
|
336
|
-
|
337
|
-
.user-about{
|
338
|
-
|
339
|
-
display: flex;
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
.image{
|
344
|
-
|
345
|
-
width: 10%;
|
346
|
-
|
347
|
-
}
|
348
|
-
|
349
|
-
.video{
|
350
|
-
|
351
|
-
width: 10%;
|
352
|
-
|
353
|
-
}
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
.profile{
|
360
|
-
|
361
|
-
margin-left: 10px;
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
.name-history{
|
366
|
-
|
367
|
-
margin-bottom: 3px;
|
368
|
-
|
369
|
-
display: flex;
|
370
|
-
|
371
|
-
width: 100%;
|
372
|
-
|
373
|
-
.name{
|
374
|
-
|
375
|
-
font-weight: bold;
|
376
|
-
|
377
|
-
}
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
.mania-histry{
|
382
|
-
|
383
|
-
margin-left: 20px;
|
384
|
-
|
385
|
-
}
|
386
|
-
|
387
|
-
}
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
.enjoy-point{
|
392
|
-
|
393
|
-
width: 100%;
|
394
|
-
|
395
|
-
font-size: 13px;
|
396
|
-
|
397
|
-
}
|
398
|
-
|
399
|
-
}
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
}
|
404
|
-
|
405
|
-
}
|
406
|
-
|
407
|
-
}
|
408
|
-
|
409
|
-
.sidebar{
|
410
|
-
|
411
|
-
width: 20%;
|
412
|
-
|
413
|
-
border: 2px solid #000;
|
414
|
-
|
415
|
-
padding: 20px;
|
416
|
-
|
417
|
-
}
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
}
|
422
|
-
|
423
|
-
```
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
今回崩れてしまっているサイドバーのHTML
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
```HTML
|
432
|
-
|
433
|
-
<div id="menu">
|
434
|
-
|
435
|
-
<div class="menu-link">
|
436
|
-
|
437
|
-
<ul id ='nav'>
|
438
|
-
|
439
|
-
<%if user_signed_in?%>
|
440
|
-
|
441
|
-
<li>
|
442
|
-
|
443
|
-
<%= link_to 'つぶやき投稿', new_post_path(@post) %>
|
444
|
-
|
445
|
-
</li>
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
<li>
|
450
|
-
|
451
|
-
<%= link_to 'つぶやき一覧', root_path %>
|
452
|
-
|
453
|
-
</li>
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
<li>
|
458
|
-
|
459
|
-
<%= link_to 'ログアウト', destroy_user_session_path, method: :delete %>
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
</li>
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
<li>
|
468
|
-
|
469
|
-
<%= link_to '動画投稿', new_movie_path %>
|
470
|
-
|
471
|
-
</li>
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
<li>
|
476
|
-
|
477
|
-
<%= link_to '動画一覧', movies_path %>
|
478
|
-
|
479
|
-
</li>
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
<li>
|
484
|
-
|
485
|
-
<%= link_to 'ブログ一覧', blogs_path %>
|
486
|
-
|
487
|
-
</li>
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
<li>
|
492
|
-
|
493
|
-
<%= link_to 'ブログ投稿', new_blog_path %>
|
494
|
-
|
495
|
-
</li>
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
<% else %>
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
<li>
|
504
|
-
|
505
|
-
<%= link_to 'ログイン', new_user_session_path %>
|
506
|
-
|
507
|
-
</li>
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
<li>
|
512
|
-
|
513
|
-
<%= link_to '新規登録', new_user_registration_path %>
|
514
|
-
|
515
|
-
</li>
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
<li>
|
520
|
-
|
521
|
-
<%= link_to '動画一覧', movies_path %>
|
522
|
-
|
523
|
-
</li>
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
<li>
|
528
|
-
|
529
|
-
<%= link_to 'ブログ一覧', blogs_path %>
|
530
|
-
|
531
|
-
</li>
|
532
|
-
|
533
|
-
<% end %>
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
</ul>
|
542
|
-
|
543
|
-
</div>
|
544
|
-
|
545
|
-
</div>
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
```
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
#やってみたこと
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
HTMLのcontent-blockの中に
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
```
|
562
|
-
|
563
|
-
<div class="sidebar">
|
564
|
-
|
565
|
-
<%= render 'shared/menu'%>
|
566
|
-
|
567
|
-
</div>
|
568
|
-
|
569
|
-
```
|
570
|
-
|
571
585
|
の記述を入れてみたところログイン中は治ったのですが、ログアウトしてしまうと以上のように横ではなく縦の場所に並んでしまいます。
|
572
586
|
|
573
587
|
なぜなのか教えていただければ幸いです
|
6
アドバイスいただいたコードを記述しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -86,37 +86,39 @@
|
|
86
86
|
|
87
87
|
</div>
|
88
88
|
|
89
|
-
<h2><%= blog.body %></h2>
|
89
|
+
<h2><%= truncate(strip_tags(blog.body.to_s),length: 14) %></h2></h2><%= link_to "コメントor続きをよむ", "/blogs/#{blog.id}" %>
|
90
90
|
|
91
91
|
</div>
|
92
92
|
|
93
|
+
|
94
|
+
|
93
|
-
|
95
|
+
<div class="action-menu">
|
94
|
-
|
96
|
+
|
95
|
-
|
97
|
+
<div id="blog_<%= blog.id %>">
|
96
|
-
|
98
|
+
|
97
|
-
|
99
|
+
<%= render 'blog', blog: blog %>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<%if user_signed_in?%>
|
106
|
+
|
107
|
+
<div class='user-action'>
|
108
|
+
|
109
|
+
<% if current_user.id == blog.user.id && user_signed_in? %>
|
110
|
+
|
111
|
+
<%= link_to "編集", edit_blog_path(blog) %>
|
112
|
+
|
113
|
+
<%= link_to "削除", blog_path(blog), method: :delete %>
|
114
|
+
|
115
|
+
<% end %>
|
98
116
|
|
99
117
|
</div>
|
100
118
|
|
101
|
-
|
102
|
-
|
103
|
-
<%if user_signed_in?%>
|
104
|
-
|
105
|
-
<div class = 'user-action'>
|
106
|
-
|
107
|
-
<% if current_user.id == blog.user.id && user_signed_in? %>
|
108
|
-
|
109
|
-
<%= link_to "編集", edit_blog_path(blog) %>
|
110
|
-
|
111
|
-
<%= link_to "削除", blog_path(blog), method: :delete %>
|
112
|
-
|
113
|
-
|
119
|
+
<% end %>
|
114
|
-
|
115
|
-
|
120
|
+
|
116
|
-
|
117
|
-
|
121
|
+
</div>
|
118
|
-
|
119
|
-
</div>
|
120
122
|
|
121
123
|
</div>
|
122
124
|
|
@@ -124,446 +126,448 @@
|
|
124
126
|
|
125
127
|
|
126
128
|
|
129
|
+
<div class="sidebar">
|
130
|
+
|
131
|
+
<%= render 'shared/menu'%>
|
132
|
+
|
133
|
+
</div>
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
</div>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
```
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
ブログページのCSS
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
```CSS
|
152
|
+
|
153
|
+
@import "font-awesome-sprockets";
|
154
|
+
|
155
|
+
@import "font-awesome";
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
body{
|
160
|
+
|
161
|
+
word-wrap: break-word;
|
162
|
+
|
163
|
+
max-width: 1080px;
|
164
|
+
|
165
|
+
margin: 0 auto;
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
img {
|
172
|
+
|
173
|
+
max-width: 100%;
|
174
|
+
|
175
|
+
}
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
.logo{
|
182
|
+
|
183
|
+
width: 140px;
|
184
|
+
|
185
|
+
text-align: center;
|
186
|
+
|
187
|
+
background-color: #333;
|
188
|
+
|
189
|
+
height: 50px;
|
190
|
+
|
191
|
+
line-height: 50px;
|
192
|
+
|
193
|
+
margin-right: 2px;
|
194
|
+
|
195
|
+
margin-bottom: 10px;
|
196
|
+
|
197
|
+
margin-top: 10px;
|
198
|
+
|
199
|
+
}
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
.logo a{
|
204
|
+
|
205
|
+
color: #fff;
|
206
|
+
|
207
|
+
text-decoration: none;
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
}
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
#menu #nav li {
|
216
|
+
|
217
|
+
list-style: none;
|
218
|
+
|
219
|
+
width: 140px;
|
220
|
+
|
221
|
+
text-align: center;
|
222
|
+
|
223
|
+
background-color: #333;
|
224
|
+
|
225
|
+
height: 50px;
|
226
|
+
|
227
|
+
line-height: 50px;
|
228
|
+
|
229
|
+
margin-right: 2px;
|
230
|
+
|
231
|
+
margin-bottom: 10px;
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
}
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
#menu #nav li a {
|
240
|
+
|
241
|
+
text-decoration: none;
|
242
|
+
|
243
|
+
color: #fff;
|
244
|
+
|
245
|
+
font-weight: bold;
|
246
|
+
|
247
|
+
padding: 20px;
|
248
|
+
|
249
|
+
}
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
#footer{
|
254
|
+
|
255
|
+
background-color: #333;
|
256
|
+
|
257
|
+
text-align: center;
|
258
|
+
|
259
|
+
color: white;
|
260
|
+
|
261
|
+
padding: 10px 0;
|
262
|
+
|
263
|
+
font-size: 13px;
|
264
|
+
|
265
|
+
margin-top: 20px;
|
266
|
+
|
267
|
+
}
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
#footer p{
|
272
|
+
|
273
|
+
margin: 0;
|
274
|
+
|
275
|
+
}
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
.toast{
|
280
|
+
|
281
|
+
margin: 10px 0;
|
282
|
+
|
283
|
+
text-align: center;
|
284
|
+
|
285
|
+
}
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
.toast .notice{
|
290
|
+
|
291
|
+
background-color: #49ac49;
|
292
|
+
|
293
|
+
color: white;
|
294
|
+
|
295
|
+
padding: 10px;
|
296
|
+
|
297
|
+
}
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
.toast .aleat{
|
302
|
+
|
303
|
+
background-color: red;
|
304
|
+
|
305
|
+
color: white;
|
306
|
+
|
307
|
+
padding: 10px;
|
308
|
+
|
309
|
+
}
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
.content-wrapper{
|
314
|
+
|
315
|
+
display: flex;
|
316
|
+
|
317
|
+
justify-content: space-between;
|
318
|
+
|
319
|
+
.content-block{
|
320
|
+
|
321
|
+
border: 2px solid #000;
|
322
|
+
|
323
|
+
padding: 20px;
|
324
|
+
|
325
|
+
width: 60%;
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
.content{
|
330
|
+
|
331
|
+
border: 2px solid #000;
|
332
|
+
|
333
|
+
padding: 15px;
|
334
|
+
|
335
|
+
margin-bottom: 10px;
|
336
|
+
|
337
|
+
.user-about{
|
338
|
+
|
339
|
+
display: flex;
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
.image{
|
344
|
+
|
345
|
+
width: 10%;
|
346
|
+
|
347
|
+
}
|
348
|
+
|
349
|
+
.video{
|
350
|
+
|
351
|
+
width: 10%;
|
352
|
+
|
353
|
+
}
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
.profile{
|
360
|
+
|
361
|
+
margin-left: 10px;
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
.name-history{
|
366
|
+
|
367
|
+
margin-bottom: 3px;
|
368
|
+
|
369
|
+
display: flex;
|
370
|
+
|
371
|
+
width: 100%;
|
372
|
+
|
373
|
+
.name{
|
374
|
+
|
375
|
+
font-weight: bold;
|
376
|
+
|
377
|
+
}
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
.mania-histry{
|
382
|
+
|
383
|
+
margin-left: 20px;
|
384
|
+
|
385
|
+
}
|
386
|
+
|
387
|
+
}
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
.enjoy-point{
|
392
|
+
|
393
|
+
width: 100%;
|
394
|
+
|
395
|
+
font-size: 13px;
|
396
|
+
|
397
|
+
}
|
398
|
+
|
399
|
+
}
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
}
|
404
|
+
|
405
|
+
}
|
406
|
+
|
407
|
+
}
|
408
|
+
|
409
|
+
.sidebar{
|
410
|
+
|
411
|
+
width: 20%;
|
412
|
+
|
413
|
+
border: 2px solid #000;
|
414
|
+
|
415
|
+
padding: 20px;
|
416
|
+
|
417
|
+
}
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
}
|
422
|
+
|
423
|
+
```
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
今回崩れてしまっているサイドバーのHTML
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
```HTML
|
432
|
+
|
433
|
+
<div id="menu">
|
434
|
+
|
435
|
+
<div class="menu-link">
|
436
|
+
|
437
|
+
<ul id ='nav'>
|
438
|
+
|
439
|
+
<%if user_signed_in?%>
|
440
|
+
|
441
|
+
<li>
|
442
|
+
|
443
|
+
<%= link_to 'つぶやき投稿', new_post_path(@post) %>
|
444
|
+
|
445
|
+
</li>
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
<li>
|
450
|
+
|
451
|
+
<%= link_to 'つぶやき一覧', root_path %>
|
452
|
+
|
453
|
+
</li>
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
<li>
|
458
|
+
|
459
|
+
<%= link_to 'ログアウト', destroy_user_session_path, method: :delete %>
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
</li>
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
<li>
|
468
|
+
|
469
|
+
<%= link_to '動画投稿', new_movie_path %>
|
470
|
+
|
471
|
+
</li>
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
<li>
|
476
|
+
|
477
|
+
<%= link_to '動画一覧', movies_path %>
|
478
|
+
|
479
|
+
</li>
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
<li>
|
484
|
+
|
485
|
+
<%= link_to 'ブログ一覧', blogs_path %>
|
486
|
+
|
487
|
+
</li>
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
<li>
|
492
|
+
|
493
|
+
<%= link_to 'ブログ投稿', new_blog_path %>
|
494
|
+
|
495
|
+
</li>
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
<% else %>
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
<li>
|
504
|
+
|
505
|
+
<%= link_to 'ログイン', new_user_session_path %>
|
506
|
+
|
507
|
+
</li>
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
<li>
|
512
|
+
|
513
|
+
<%= link_to '新規登録', new_user_registration_path %>
|
514
|
+
|
515
|
+
</li>
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
<li>
|
520
|
+
|
521
|
+
<%= link_to '動画一覧', movies_path %>
|
522
|
+
|
523
|
+
</li>
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
<li>
|
528
|
+
|
529
|
+
<%= link_to 'ブログ一覧', blogs_path %>
|
530
|
+
|
531
|
+
</li>
|
532
|
+
|
533
|
+
<% end %>
|
534
|
+
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
</ul>
|
542
|
+
|
127
543
|
</div>
|
128
544
|
|
129
|
-
<div class="sidebar">
|
130
|
-
|
131
|
-
<%= render 'shared/menu'%>
|
132
|
-
|
133
|
-
|
545
|
+
</div>
|
134
|
-
|
135
|
-
|
546
|
+
|
547
|
+
|
136
548
|
|
137
549
|
```
|
138
550
|
|
139
551
|
|
140
552
|
|
141
|
-
ブログページのCSS
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
```CSS
|
146
|
-
|
147
|
-
@import "font-awesome-sprockets";
|
148
|
-
|
149
|
-
@import "font-awesome";
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
body{
|
154
|
-
|
155
|
-
word-wrap: break-word;
|
156
|
-
|
157
|
-
max-width: 1080px;
|
158
|
-
|
159
|
-
margin: 0 auto;
|
160
|
-
|
161
|
-
}
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
img {
|
166
|
-
|
167
|
-
max-width: 100%;
|
168
|
-
|
169
|
-
}
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
.logo{
|
176
|
-
|
177
|
-
width: 140px;
|
178
|
-
|
179
|
-
text-align: center;
|
180
|
-
|
181
|
-
background-color: #333;
|
182
|
-
|
183
|
-
height: 50px;
|
184
|
-
|
185
|
-
line-height: 50px;
|
186
|
-
|
187
|
-
margin-right: 2px;
|
188
|
-
|
189
|
-
margin-bottom: 10px;
|
190
|
-
|
191
|
-
margin-top: 10px;
|
192
|
-
|
193
|
-
}
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
.logo a{
|
198
|
-
|
199
|
-
color: #fff;
|
200
|
-
|
201
|
-
text-decoration: none;
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
}
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
#menu #nav li {
|
210
|
-
|
211
|
-
list-style: none;
|
212
|
-
|
213
|
-
width: 140px;
|
214
|
-
|
215
|
-
text-align: center;
|
216
|
-
|
217
|
-
background-color: #333;
|
218
|
-
|
219
|
-
height: 50px;
|
220
|
-
|
221
|
-
line-height: 50px;
|
222
|
-
|
223
|
-
margin-right: 2px;
|
224
|
-
|
225
|
-
margin-bottom: 10px;
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
}
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
#menu #nav li a {
|
234
|
-
|
235
|
-
text-decoration: none;
|
236
|
-
|
237
|
-
color: #fff;
|
238
|
-
|
239
|
-
font-weight: bold;
|
240
|
-
|
241
|
-
padding: 20px;
|
242
|
-
|
243
|
-
}
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
#
|
553
|
+
#やってみたこと
|
248
|
-
|
249
|
-
|
554
|
+
|
250
|
-
|
251
|
-
|
555
|
+
|
252
|
-
|
253
|
-
|
556
|
+
|
254
|
-
|
255
|
-
padding: 10px 0;
|
256
|
-
|
257
|
-
font-size: 13px;
|
258
|
-
|
259
|
-
margin-top: 20px;
|
260
|
-
|
261
|
-
}
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
#footer p{
|
266
|
-
|
267
|
-
margin: 0;
|
268
|
-
|
269
|
-
}
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
.toast{
|
274
|
-
|
275
|
-
margin: 10px 0;
|
276
|
-
|
277
|
-
text-align: center;
|
278
|
-
|
279
|
-
}
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
.toast .notice{
|
284
|
-
|
285
|
-
background-color: #49ac49;
|
286
|
-
|
287
|
-
color: white;
|
288
|
-
|
289
|
-
padding: 10px;
|
290
|
-
|
291
|
-
}
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
.toast .aleat{
|
296
|
-
|
297
|
-
background-color: red;
|
298
|
-
|
299
|
-
color: white;
|
300
|
-
|
301
|
-
padding: 10px;
|
302
|
-
|
303
|
-
}
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
.content-wrapper{
|
308
|
-
|
309
|
-
display: flex;
|
310
|
-
|
311
|
-
justify-content: space-between;
|
312
|
-
|
313
|
-
|
557
|
+
HTMLのcontent-blockの中に
|
314
|
-
|
315
|
-
|
558
|
+
|
316
|
-
|
317
|
-
|
559
|
+
|
318
|
-
|
319
|
-
width: 60%;
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
.content{
|
324
|
-
|
325
|
-
border: 2px solid #000;
|
326
|
-
|
327
|
-
padding: 15px;
|
328
|
-
|
329
|
-
margin-bottom: 10px;
|
330
|
-
|
331
|
-
.user-about{
|
332
|
-
|
333
|
-
display: flex;
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
.image{
|
338
|
-
|
339
|
-
width: 10%;
|
340
|
-
|
341
|
-
}
|
342
|
-
|
343
|
-
.video{
|
344
|
-
|
345
|
-
width: 10%;
|
346
|
-
|
347
|
-
}
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
.profile{
|
354
|
-
|
355
|
-
margin-left: 10px;
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
.name-history{
|
360
|
-
|
361
|
-
margin-bottom: 3px;
|
362
|
-
|
363
|
-
display: flex;
|
364
|
-
|
365
|
-
width: 100%;
|
366
|
-
|
367
|
-
.name{
|
368
|
-
|
369
|
-
font-weight: bold;
|
370
|
-
|
371
|
-
}
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
.mania-histry{
|
376
|
-
|
377
|
-
margin-left: 20px;
|
378
|
-
|
379
|
-
}
|
380
|
-
|
381
|
-
}
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
.enjoy-point{
|
386
|
-
|
387
|
-
width: 100%;
|
388
|
-
|
389
|
-
font-size: 13px;
|
390
|
-
|
391
|
-
}
|
392
|
-
|
393
|
-
}
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
}
|
398
|
-
|
399
|
-
}
|
400
|
-
|
401
|
-
}
|
402
|
-
|
403
|
-
.sidebar{
|
404
|
-
|
405
|
-
width: 20%;
|
406
|
-
|
407
|
-
border: 2px solid #000;
|
408
|
-
|
409
|
-
padding: 20px;
|
410
|
-
|
411
|
-
}
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
}
|
416
560
|
|
417
561
|
```
|
418
562
|
|
419
|
-
|
420
|
-
|
421
|
-
今回崩れてしまっているサイドバーのHTML
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
```HTML
|
426
|
-
|
427
|
-
<div id="menu">
|
428
|
-
|
429
|
-
|
563
|
+
<div class="sidebar">
|
430
|
-
|
431
|
-
|
564
|
+
|
432
|
-
|
433
|
-
<%if user_signed_in?%>
|
434
|
-
|
435
|
-
<li>
|
436
|
-
|
437
|
-
<%= link_to 'つぶやき投稿', new_post_path(@post) %>
|
438
|
-
|
439
|
-
</li>
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
<li>
|
444
|
-
|
445
|
-
|
565
|
+
<%= render 'shared/menu'%>
|
446
|
-
|
447
|
-
|
566
|
+
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
<li>
|
452
|
-
|
453
|
-
<%= link_to 'ログアウト', destroy_user_session_path, method: :delete %>
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
</li>
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
<li>
|
462
|
-
|
463
|
-
<%= link_to '動画投稿', new_movie_path %>
|
464
|
-
|
465
|
-
</li>
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
<li>
|
470
|
-
|
471
|
-
<%= link_to '動画一覧', movies_path %>
|
472
|
-
|
473
|
-
</li>
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
</li>
|
478
|
-
|
479
|
-
<li>
|
480
|
-
|
481
|
-
<%= link_to 'ブログ一覧', blogs_path %>
|
482
|
-
|
483
|
-
</li>
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
<li>
|
488
|
-
|
489
|
-
<%= link_to 'ブログ投稿', new_blog_path %>
|
490
|
-
|
491
|
-
</li>
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
<% else %>
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
<li>
|
500
|
-
|
501
|
-
<%= link_to 'ログイン', new_user_session_path %>
|
502
|
-
|
503
|
-
</li>
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
<li>
|
508
|
-
|
509
|
-
<%= link_to '新規登録', new_user_registration_path %>
|
510
|
-
|
511
|
-
</li>
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
<li>
|
516
|
-
|
517
|
-
<%= link_to '動画一覧', movies_path %>
|
518
|
-
|
519
|
-
</li>
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
<li>
|
524
|
-
|
525
|
-
<%= link_to 'ブログ一覧', blogs_path %>
|
526
|
-
|
527
|
-
</li>
|
528
|
-
|
529
|
-
<% end %>
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
</ul>
|
538
|
-
|
539
|
-
</div>
|
567
|
+
</div>
|
540
|
-
|
541
|
-
</div>
|
542
|
-
|
543
|
-
|
544
568
|
|
545
569
|
```
|
546
570
|
|
547
|
-
|
548
|
-
|
549
|
-
#やってみたこと
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
HTMLのcontent-blockの中に
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
```
|
558
|
-
|
559
|
-
<div class="sidebar">
|
560
|
-
|
561
|
-
<%= render 'shared/menu'%>
|
562
|
-
|
563
|
-
</div>
|
564
|
-
|
565
|
-
```
|
566
|
-
|
567
571
|
の記述を入れてみたところログイン中は治ったのですが、ログアウトしてしまうと以上のように横ではなく縦の場所に並んでしまいます。
|
568
572
|
|
569
573
|
なぜなのか教えていただければ幸いです
|
5
間違った画像を貼っていたので戻しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
今の状態
|
12
12
|
|
13
|
-
![イメージ説明](
|
13
|
+
![イメージ説明](3c0f3d5a31c10f5b969c8c26573981fb.png)
|
14
14
|
|
15
15
|
これらを期待される状態に戻したいです。
|
16
16
|
|
4
やってみたことの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,6 +18,8 @@
|
|
18
18
|
|
19
19
|
#問題のソースコード
|
20
20
|
|
21
|
+
一覧ページのHTML
|
22
|
+
|
21
23
|
|
22
24
|
|
23
25
|
```HTML
|
@@ -541,3 +543,27 @@
|
|
541
543
|
|
542
544
|
|
543
545
|
```
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
#やってみたこと
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
HTMLのcontent-blockの中に
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
```
|
558
|
+
|
559
|
+
<div class="sidebar">
|
560
|
+
|
561
|
+
<%= render 'shared/menu'%>
|
562
|
+
|
563
|
+
</div>
|
564
|
+
|
565
|
+
```
|
566
|
+
|
567
|
+
の記述を入れてみたところログイン中は治ったのですが、ログアウトしてしまうと以上のように横ではなく縦の場所に並んでしまいます。
|
568
|
+
|
569
|
+
なぜなのか教えていただければ幸いです
|
3
表現を変えました
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,23 +2,17 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
|
5
|
+
期待される状態
|
6
|
+
|
6
|
-
|
7
|
+
![イメージ説明](b76708353a0155f404dc30c3da530e79.png)
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
今の状態
|
12
|
+
|
7
|
-
![イメージ説明](
|
13
|
+
![イメージ説明](b563a7c062f91f356f6a493ba4278538.png)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
14
|
+
|
12
|
-
|
13
|
-
![](3972262cc8e90e590477ef4db8da76e4.png)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
これらを期待される状態に戻したいです。
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
![イメージ説明](5f61af5db45e672a3c7f1c003c222bcb.png)
|
22
16
|
|
23
17
|
|
24
18
|
|
2
何がしたいのか不明瞭だったので追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,6 +14,14 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
+
ログアウトしていたとしても以下のようにサイドバーが横にあるようにしたいのですができません
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
![イメージ説明](5f61af5db45e672a3c7f1c003c222bcb.png)
|
22
|
+
|
23
|
+
|
24
|
+
|
17
25
|
#問題のソースコード
|
18
26
|
|
19
27
|
|
1
サイドバーのHTLMを記述しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -411,3 +411,131 @@
|
|
411
411
|
}
|
412
412
|
|
413
413
|
```
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
今回崩れてしまっているサイドバーのHTML
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
```HTML
|
422
|
+
|
423
|
+
<div id="menu">
|
424
|
+
|
425
|
+
<div class="menu-link">
|
426
|
+
|
427
|
+
<ul id ='nav'>
|
428
|
+
|
429
|
+
<%if user_signed_in?%>
|
430
|
+
|
431
|
+
<li>
|
432
|
+
|
433
|
+
<%= link_to 'つぶやき投稿', new_post_path(@post) %>
|
434
|
+
|
435
|
+
</li>
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
<li>
|
440
|
+
|
441
|
+
<%= link_to 'つぶやき一覧', root_path %>
|
442
|
+
|
443
|
+
</li>
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
<li>
|
448
|
+
|
449
|
+
<%= link_to 'ログアウト', destroy_user_session_path, method: :delete %>
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
</li>
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
<li>
|
458
|
+
|
459
|
+
<%= link_to '動画投稿', new_movie_path %>
|
460
|
+
|
461
|
+
</li>
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
<li>
|
466
|
+
|
467
|
+
<%= link_to '動画一覧', movies_path %>
|
468
|
+
|
469
|
+
</li>
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
</li>
|
474
|
+
|
475
|
+
<li>
|
476
|
+
|
477
|
+
<%= link_to 'ブログ一覧', blogs_path %>
|
478
|
+
|
479
|
+
</li>
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
<li>
|
484
|
+
|
485
|
+
<%= link_to 'ブログ投稿', new_blog_path %>
|
486
|
+
|
487
|
+
</li>
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
<% else %>
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
<li>
|
496
|
+
|
497
|
+
<%= link_to 'ログイン', new_user_session_path %>
|
498
|
+
|
499
|
+
</li>
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
<li>
|
504
|
+
|
505
|
+
<%= link_to '新規登録', new_user_registration_path %>
|
506
|
+
|
507
|
+
</li>
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
<li>
|
512
|
+
|
513
|
+
<%= link_to '動画一覧', movies_path %>
|
514
|
+
|
515
|
+
</li>
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
<li>
|
520
|
+
|
521
|
+
<%= link_to 'ブログ一覧', blogs_path %>
|
522
|
+
|
523
|
+
</li>
|
524
|
+
|
525
|
+
<% end %>
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
</ul>
|
534
|
+
|
535
|
+
</div>
|
536
|
+
|
537
|
+
</div>
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
```
|