質問編集履歴
4
文の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -136,53 +136,27 @@
|
|
136
136
|
|
137
137
|
```
|
138
138
|
|
139
|
-
|
139
|
+
config/environments/production.rb
|
140
140
|
|
141
|
-
<nav>
|
142
141
|
|
143
|
-
<ul class="nav nav-js">
|
144
142
|
|
145
|
-
|
143
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
146
144
|
|
147
|
-
<li>
|
148
145
|
|
149
|
-
<li><%= link_to(@current_user.name, "/users/#{@current_user.id}", {class: "nav-item"}) %></li>
|
150
146
|
|
151
|
-
|
147
|
+
# Compress JavaScripts and CSS.
|
152
148
|
|
153
|
-
|
149
|
+
config.assets.js_compressor = Uglifier.new(harmony: true)
|
154
150
|
|
155
|
-
|
151
|
+
# config.assets.css_compressor = :sass
|
156
152
|
|
157
|
-
<li><%= link_to("ユーザー一覧", "/users/index", {class: "nav-item"}) %></li>
|
158
153
|
|
159
|
-
<li><%= link_to("ログアウト", "/logout", {method: :post , class: "nav-item"}) %></li>
|
160
154
|
|
161
|
-
|
155
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
162
156
|
|
163
|
-
|
157
|
+
config.assets.compile = true
|
164
158
|
|
165
|
-
<li><%= link_to("新規登録", "/signup", {class: "nav-item"}) %></li>
|
166
159
|
|
167
|
-
<li><%= link_to("ログイン", "/login", {class: "nav-item"}) %></li>
|
168
|
-
|
169
|
-
<% end %>
|
170
|
-
|
171
|
-
</ul>
|
172
|
-
|
173
|
-
</nav>
|
174
|
-
|
175
|
-
.
|
176
|
-
|
177
|
-
.
|
178
|
-
|
179
|
-
.
|
180
|
-
|
181
|
-
<%= yield %>
|
182
|
-
|
183
|
-
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
184
|
-
|
185
|
-
</body>
|
186
160
|
|
187
161
|
```
|
188
162
|
|
@@ -190,6 +164,4 @@
|
|
190
164
|
|
191
165
|
## 試したこと
|
192
166
|
|
193
|
-
=> const nav = document.getElementsByClassName("nav-js")[0];
|
194
|
-
|
195
|
-
|
167
|
+
Uglifier.new(harmony: true)と記述したが、エラーが発生し、なにが間違っているのかがわからない
|
3
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,9 @@
|
|
12
12
|
|
13
13
|
ターミナル
|
14
14
|
|
15
|
+
Uglifier::Error: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).
|
15
16
|
|
17
|
+
省略
|
16
18
|
|
17
19
|
remote: 2299
|
18
20
|
|
2
javascript タグを追加
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
aplication.html.erbにjsタグを追加した
test
CHANGED
File without changes
|
test
CHANGED
@@ -170,7 +170,17 @@
|
|
170
170
|
|
171
171
|
</nav>
|
172
172
|
|
173
|
+
.
|
173
174
|
|
175
|
+
.
|
176
|
+
|
177
|
+
.
|
178
|
+
|
179
|
+
<%= yield %>
|
180
|
+
|
181
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
182
|
+
|
183
|
+
</body>
|
174
184
|
|
175
185
|
```
|
176
186
|
|