質問編集履歴

4

試したことの追加

2019/12/15 04:16

投稿

sn.jr
sn.jr

スコア53

test CHANGED
File without changes
test CHANGED
@@ -249,3 +249,15 @@
249
249
  ##試したこと
250
250
 
251
251
  index.html.erbを全部消したら、エラーが解消されたのでviewにやはり問題があるかと思います。
252
+
253
+ 下記の部分の有無でエラーの有無も影響しているみたいです。(index.html.erb)
254
+
255
+
256
+
257
+ ```
258
+
259
+ <%= link_to "削除", article, method: :delete,
260
+
261
+ data: {confirm: "本当に削除しますか?"} %>
262
+
263
+ ```

3

試したことを追加

2019/12/15 04:16

投稿

sn.jr
sn.jr

スコア53

test CHANGED
File without changes
test CHANGED
@@ -245,3 +245,7 @@
245
245
 
246
246
 
247
247
  ```
248
+
249
+ ##試したこと
250
+
251
+ index.html.erbを全部消したら、エラーが解消されたのでviewにやはり問題があるかと思います。

2

routesの追加

2019/12/15 04:12

投稿

sn.jr
sn.jr

スコア53

test CHANGED
File without changes
test CHANGED
@@ -171,3 +171,77 @@
171
171
 
172
172
 
173
173
  ```
174
+
175
+ ```rb
176
+
177
+ Prefix Verb URI Pattern Controller#Action
178
+
179
+ passwords_edit GET /passwords/edit(.:format) passwords#edit
180
+
181
+ accounts_show GET /accounts/show(.:format) accounts#show
182
+
183
+ accounts_edit GET /accounts/edit(.:format) accounts#edit
184
+
185
+ top_index GET /top/index(.:format) top#index
186
+
187
+ search_members GET /members/search(.:format) members#search
188
+
189
+ members GET /members(.:format) members#index
190
+
191
+ POST /members(.:format) members#create
192
+
193
+ new_member GET /members/new(.:format) members#new
194
+
195
+ edit_member GET /members/:id/edit(.:format) members#edit
196
+
197
+ member GET /members/:id(.:format) members#show
198
+
199
+ PATCH /members/:id(.:format) members#update
200
+
201
+ PUT /members/:id(.:format) members#update
202
+
203
+ DELETE /members/:id(.:format) members#destroy
204
+
205
+ root GET / top#index
206
+
207
+ about GET /about(.:format) top#about
208
+
209
+ session DELETE /session(.:format) sessions#destroy
210
+
211
+ POST /session(.:format) sessions#create
212
+
213
+ edit_account GET /account/edit(.:format) accounts#edit
214
+
215
+ account GET /account(.:format) accounts#show
216
+
217
+ PATCH /account(.:format) accounts#update
218
+
219
+ PUT /account(.:format) accounts#update
220
+
221
+ edit_password GET /password/edit(.:format) passwords#edit
222
+
223
+ password GET /password(.:format) passwords#show
224
+
225
+ PATCH /password(.:format) passwords#update
226
+
227
+ PUT /password(.:format) passwords#update
228
+
229
+ articles GET /articles(.:format) articles#index
230
+
231
+ POST /articles(.:format) articles#create
232
+
233
+ new_article GET /articles/new(.:format) articles#new
234
+
235
+ edit_article GET /articles/:id/edit(.:format) articles#edit
236
+
237
+ article GET /articles/:id(.:format) articles#show
238
+
239
+ PATCH /articles/:id(.:format) articles#update
240
+
241
+ PUT /articles/:id(.:format) articles#update
242
+
243
+ DELETE /articles/:id(.:format) articles#destroy
244
+
245
+
246
+
247
+ ```

1

menu_link_toの定義を追加

2019/12/15 02:49

投稿

sn.jr
sn.jr

スコア53

test CHANGED
File without changes
test CHANGED
@@ -133,3 +133,41 @@
133
133
 
134
134
 
135
135
  ```
136
+
137
+ menu_link_toに関して
138
+
139
+
140
+
141
+ ```rb
142
+
143
+ module ApplicationHelper
144
+
145
+ def page_title
146
+
147
+ title = "Wakatta"
148
+
149
+ title = @page_title + "-" + title if @page_title
150
+
151
+ title
152
+
153
+ end
154
+
155
+ def menu_link_to(text, path, options ={})
156
+
157
+ content_tag :li do
158
+
159
+ link_to_unless_current(text, path, options) do
160
+
161
+ content_tag(:span, text)
162
+
163
+ end
164
+
165
+ end
166
+
167
+ end
168
+
169
+ end
170
+
171
+
172
+
173
+ ```