質問編集履歴
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -103,3 +103,43 @@
|
|
103
103
|
end
|
104
104
|
|
105
105
|
```
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
#追記
|
110
|
+
|
111
|
+
**routes.rb**
|
112
|
+
|
113
|
+
```
|
114
|
+
|
115
|
+
Rails.application.routes.draw do
|
116
|
+
|
117
|
+
root 'static_pages#home'
|
118
|
+
|
119
|
+
get '/about' => 'static_pages#about'
|
120
|
+
|
121
|
+
get '/contact' => 'static_pages#contact'
|
122
|
+
|
123
|
+
resources :categories do
|
124
|
+
|
125
|
+
resources :posts
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
resources :posts do
|
130
|
+
|
131
|
+
resources :comments
|
132
|
+
|
133
|
+
resources :tags
|
134
|
+
|
135
|
+
end
|
136
|
+
|
137
|
+
get 'tags/:name' => 'tags#show'
|
138
|
+
|
139
|
+
resources :tags, only: [:index, :show]
|
140
|
+
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
```
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,6 +9,10 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
tagsの一覧を表示することまではできた(tagsのindexページ)のですが、show.html.erbページに紐づいているpostテキストリンクを生成することができません。
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
postとtagで親子関係を作らないといけないのでしょうか?
|
12
16
|
|
13
17
|
|
14
18
|
|