teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

views/layouts/aplication.html.slimの追記

2019/10/12 09:59

投稿

puromin
puromin

スコア13

title CHANGED
File without changes
body CHANGED
@@ -43,7 +43,7 @@
43
43
  稚拙な質問ですが、ご教授よろしくお願いいたします。
44
44
 
45
45
  # 追記
46
- aplication.scss
46
+ **aplication.scss**
47
47
  ```scss
48
48
  /*
49
49
  * This is a manifest file that'll be compiled into application.css, which will include all the files
@@ -65,4 +65,24 @@
65
65
  @import "bootstrap";
66
66
  @import "home";
67
67
  ```
68
- @import "home"は記載がないとなぜかcss自体が反映されなかったので、ここに記述しました。
68
+ @import "home"は記載がないとなぜかcss自体が反映されなかったので、ここに記述しました。
69
+
70
+ **views/layouts/aplication.html.slim**
71
+ ```slim
72
+ doctype html
73
+ html
74
+ head
75
+ title
76
+ | AppTest
77
+ = csrf_meta_tags
78
+ = csp_meta_tag
79
+ = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
80
+ = javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
81
+ body
82
+ .app-title.navbar.navbar-expand-md.navbar-light.bg-light
83
+ .container
84
+ - if flash.notice.present?
85
+ .alert.alert-success= flash.notice
86
+ = yield
87
+ ```
88
+ 参照している教材がslimを使うことを推奨していたため、slim形式で記述しています。

1

aplication.scssの追記

2019/10/12 09:59

投稿

puromin
puromin

スコア13

title CHANGED
File without changes
body CHANGED
@@ -40,4 +40,29 @@
40
40
  他の場所にcssを記載はしていません。
41
41
  開発環境で作業をしています。
42
42
  railsのバージョンは5.2.3です。
43
- 稚拙な質問ですが、ご教授よろしくお願いいたします。
43
+ 稚拙な質問ですが、ご教授よろしくお願いいたします。
44
+
45
+ # 追記
46
+ aplication.scss
47
+ ```scss
48
+ /*
49
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
50
+ * listed below.
51
+ *
52
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
53
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
54
+ *
55
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
56
+ * compiled file so the styles you add here take precedence over styles defined in any styles
57
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
58
+ * file per style scope.
59
+ *
60
+ *= require bootstrap
61
+ *= require_tree .
62
+ *= require_self
63
+ */
64
+
65
+ @import "bootstrap";
66
+ @import "home";
67
+ ```
68
+ @import "home"は記載がないとなぜかcss自体が反映されなかったので、ここに記述しました。