質問編集履歴
4
試したことの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -123,4 +123,10 @@
|
|
123
123
|
|
124
124
|
```
|
125
125
|
##試したこと
|
126
|
-
index.html.erbを全部消したら、エラーが解消されたのでviewにやはり問題があるかと思います。
|
126
|
+
index.html.erbを全部消したら、エラーが解消されたのでviewにやはり問題があるかと思います。
|
127
|
+
下記の部分の有無でエラーの有無も影響しているみたいです。(index.html.erb)
|
128
|
+
|
129
|
+
```
|
130
|
+
<%= link_to "削除", article, method: :delete,
|
131
|
+
data: {confirm: "本当に削除しますか?"} %>
|
132
|
+
```
|
3
試したことを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -121,4 +121,6 @@
|
|
121
121
|
PUT /articles/:id(.:format) articles#update
|
122
122
|
DELETE /articles/:id(.:format) articles#destroy
|
123
123
|
|
124
|
-
```
|
124
|
+
```
|
125
|
+
##試したこと
|
126
|
+
index.html.erbを全部消したら、エラーが解消されたのでviewにやはり問題があるかと思います。
|
2
routesの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -84,4 +84,41 @@
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
+
```
|
88
|
+
```rb
|
89
|
+
Prefix Verb URI Pattern Controller#Action
|
90
|
+
passwords_edit GET /passwords/edit(.:format) passwords#edit
|
91
|
+
accounts_show GET /accounts/show(.:format) accounts#show
|
92
|
+
accounts_edit GET /accounts/edit(.:format) accounts#edit
|
93
|
+
top_index GET /top/index(.:format) top#index
|
94
|
+
search_members GET /members/search(.:format) members#search
|
95
|
+
members GET /members(.:format) members#index
|
96
|
+
POST /members(.:format) members#create
|
97
|
+
new_member GET /members/new(.:format) members#new
|
98
|
+
edit_member GET /members/:id/edit(.:format) members#edit
|
99
|
+
member GET /members/:id(.:format) members#show
|
100
|
+
PATCH /members/:id(.:format) members#update
|
101
|
+
PUT /members/:id(.:format) members#update
|
102
|
+
DELETE /members/:id(.:format) members#destroy
|
103
|
+
root GET / top#index
|
104
|
+
about GET /about(.:format) top#about
|
105
|
+
session DELETE /session(.:format) sessions#destroy
|
106
|
+
POST /session(.:format) sessions#create
|
107
|
+
edit_account GET /account/edit(.:format) accounts#edit
|
108
|
+
account GET /account(.:format) accounts#show
|
109
|
+
PATCH /account(.:format) accounts#update
|
110
|
+
PUT /account(.:format) accounts#update
|
111
|
+
edit_password GET /password/edit(.:format) passwords#edit
|
112
|
+
password GET /password(.:format) passwords#show
|
113
|
+
PATCH /password(.:format) passwords#update
|
114
|
+
PUT /password(.:format) passwords#update
|
115
|
+
articles GET /articles(.:format) articles#index
|
116
|
+
POST /articles(.:format) articles#create
|
117
|
+
new_article GET /articles/new(.:format) articles#new
|
118
|
+
edit_article GET /articles/:id/edit(.:format) articles#edit
|
119
|
+
article GET /articles/:id(.:format) articles#show
|
120
|
+
PATCH /articles/:id(.:format) articles#update
|
121
|
+
PUT /articles/:id(.:format) articles#update
|
122
|
+
DELETE /articles/:id(.:format) articles#destroy
|
123
|
+
|
87
124
|
```
|
1
menu_link_toの定義を追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -65,4 +65,23 @@
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
```
|
69
|
+
menu_link_toに関して
|
70
|
+
|
71
|
+
```rb
|
72
|
+
module ApplicationHelper
|
73
|
+
def page_title
|
74
|
+
title = "Wakatta"
|
75
|
+
title = @page_title + "-" + title if @page_title
|
76
|
+
title
|
77
|
+
end
|
78
|
+
def menu_link_to(text, path, options ={})
|
79
|
+
content_tag :li do
|
80
|
+
link_to_unless_current(text, path, options) do
|
81
|
+
content_tag(:span, text)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
68
87
|
```
|