質問編集履歴
2
マイグレーションファイルとルーティング(少し省略しています)を追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -174,6 +174,128 @@
|
|
174
174
|
|
175
175
|
|
176
176
|
|
177
|
+
```migrate
|
178
|
+
|
179
|
+
class CreateCoats < ActiveRecord::Migration[6.0]
|
180
|
+
|
181
|
+
def change
|
182
|
+
|
183
|
+
create_table :coats do |t|
|
184
|
+
|
185
|
+
t.string :name
|
186
|
+
|
187
|
+
t.string :address
|
188
|
+
|
189
|
+
t.text :body
|
190
|
+
|
191
|
+
t.string :url
|
192
|
+
|
193
|
+
t.boolean :display
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
t.timestamps
|
198
|
+
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
202
|
+
|
203
|
+
end
|
204
|
+
|
205
|
+
```
|
206
|
+
|
207
|
+
```railsroutes
|
208
|
+
|
209
|
+
Prefix Verb URI Pattern Controller#Action
|
210
|
+
|
211
|
+
new_user_session GET /users/sign_in(.:format) devise/sessions#new
|
212
|
+
|
213
|
+
user_session POST /users/sign_in(.:format) devise/sessions#create
|
214
|
+
|
215
|
+
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
|
216
|
+
|
217
|
+
new_user_password GET /users/password/new(.:format) devise/passwords#new
|
218
|
+
|
219
|
+
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
|
220
|
+
|
221
|
+
user_password PATCH /users/password(.:format) devise/passwords#update
|
222
|
+
|
223
|
+
PUT /users/password(.:format) devise/passwords#update
|
224
|
+
|
225
|
+
POST /users/password(.:format) devise/passwords#create
|
226
|
+
|
227
|
+
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
|
228
|
+
|
229
|
+
new_user_registration GET /users/sign_up(.:format) devise/registrations#new
|
230
|
+
|
231
|
+
edit_user_registration GET /users/edit(.:format) devise/registrations#edit
|
232
|
+
|
233
|
+
user_registration PATCH /users(.:format) devise/registrations#update
|
234
|
+
|
235
|
+
PUT /users(.:format) devise/registrations#update
|
236
|
+
|
237
|
+
DELETE /users(.:format) devise/registrations#destroy
|
238
|
+
|
239
|
+
POST /users(.:format) devise/registrations#create
|
240
|
+
|
241
|
+
user GET /users/:id(.:format) users#show
|
242
|
+
|
243
|
+
coat_likes POST /coats/:coat_id/likes(.:format) likes#create
|
244
|
+
|
245
|
+
coat_like DELETE /coats/:coat_id/likes/:id(.:format) likes#destroy
|
246
|
+
|
247
|
+
coats GET /coats(.:format) coats#index
|
248
|
+
|
249
|
+
POST /coats(.:format) coats#create
|
250
|
+
|
251
|
+
new_coat GET /coats/new(.:format) coats#new
|
252
|
+
|
253
|
+
edit_coat GET /coats/:id/edit(.:format) coats#edit
|
254
|
+
|
255
|
+
coat GET /coats/:id(.:format) coats#show
|
256
|
+
|
257
|
+
PATCH /coats/:id(.:format) coats#update
|
258
|
+
|
259
|
+
PUT /coats/:id(.:format) coats#update
|
260
|
+
|
261
|
+
DELETE /coats/:id(.:format) coats#destroy
|
262
|
+
|
263
|
+
users GET /users(.:format) users#index
|
264
|
+
|
265
|
+
POST /users(.:format) users#create
|
266
|
+
|
267
|
+
new_user GET /users/new(.:format) users#new
|
268
|
+
|
269
|
+
edit_user GET /users/:id/edit(.:format) users#edit
|
270
|
+
|
271
|
+
GET /users/:id(.:format) users#show
|
272
|
+
|
273
|
+
PATCH /users/:id(.:format) users#update
|
274
|
+
|
275
|
+
PUT /users/:id(.:format) users#update
|
276
|
+
|
277
|
+
DELETE /users/:id(.:format) users#destroy
|
278
|
+
|
279
|
+
statics GET /statics(.:format) statics#index
|
280
|
+
|
281
|
+
POST /statics(.:format) statics#create
|
282
|
+
|
283
|
+
new_static GET /statics/new(.:format) statics#new
|
284
|
+
|
285
|
+
edit_static GET /statics/:id/edit(.:format) statics#edit
|
286
|
+
|
287
|
+
static GET /statics/:id(.:format) statics#show
|
288
|
+
|
289
|
+
PATCH /statics/:id(.:format) statics#update
|
290
|
+
|
291
|
+
PUT /statics/:id(.:format) statics#update
|
292
|
+
|
293
|
+
DELETE /statics/:id(.:format) statics#destroy
|
294
|
+
|
295
|
+
root GET / coats#index
|
296
|
+
|
297
|
+
```
|
298
|
+
|
177
299
|
|
178
300
|
|
179
301
|
### 補足情報(FW/ツールのバージョンなど)
|
1
誤字があったため直しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,12 +7,6 @@
|
|
7
7
|
そのデータが保存されれば一覧ページにうつり、
|
8
8
|
|
9
9
|
保存されなければ投稿フォームを繰り返すというページを作っています。
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
また、coatsテーブルにdisplayカラム(boolen型)があるのは、
|
14
|
-
|
15
|
-
後でコート情報を表示させるかさせないかを承認制にするためです。
|
16
10
|
|
17
11
|
|
18
12
|
|