質問編集履歴

3

エラーの追記

2018/01/08 16:28

投稿

komorigasa
komorigasa

スコア9

test CHANGED
File without changes
test CHANGED
@@ -346,106 +346,34 @@
346
346
 
347
347
  ```
348
348
 
349
- ### rails routesの結果
350
-
351
-
352
-
353
- ```
354
-
355
- Prefix Verb URI Pattern Controller#Action
356
-
357
- listings GET /listings(.:format) listings#index
358
-
359
- POST /listings(.:format) listings#create
360
-
361
- new_listing GET /listings/new(.:format) listings#new
362
-
363
- edit_listing GET /listings/:id/edit(.:format) listings#edit
364
-
365
- listing GET /listings/:id(.:format) listings#show
366
-
367
- PATCH /listings/:id(.:format) listings#update
368
-
369
- PUT /listings/:id(.:format) listings#update
370
-
371
- DELETE /listings/:id(.:format) listings#destroy
372
-
373
- root GET / pages#index
374
-
375
- new_user_session GET /users/sign_in(.:format) devise/sessions#new
376
-
377
- user_session POST /users/sign_in(.:format) devise/sessions#create
378
-
379
- destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
380
-
381
- user_facebook_omniauth_authorize GET|POST /users/auth/facebook(.:format) users/omniauth_callbacks#passthru
382
-
383
- user_facebook_omniauth_callback GET|POST /users/auth/facebook/callback(.:format) users/omniauth_callbacks#facebook
384
-
385
- new_user_password GET /users/password/new(.:format) devise/passwords#new
386
-
387
- edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
388
-
389
- user_password PATCH /users/password(.:format) devise/passwords#update
390
-
391
- PUT /users/password(.:format) devise/passwords#update
392
-
393
- POST /users/password(.:format) devise/passwords#create
394
-
395
- cancel_user_registration GET /users/cancel(.:format) registrations#cancel
396
-
397
- new_user_registration GET /users/sign_up(.:format) registrations#new
398
-
399
- edit_user_registration GET /users/edit(.:format) registrations#edit
400
-
401
- user_registration PATCH /users(.:format) registrations#update
402
-
403
- PUT /users(.:format) registrations#update
404
-
405
- DELETE /users(.:format) registrations#destroy
406
-
407
- POST /users(.:format) registrations#create
408
-
409
- user GET /users/:id(.:format) users#show
410
-
411
- list_photos GET /photos/list(.:format) photos#list
412
-
413
- photos POST /photos(.:format) photos#create
414
-
415
- photo DELETE /photos/:id(.:format) photos#destroy
416
-
417
- **listing_reservations POST /listings/:listing_id/reservations(.:format) reservations#create**
418
-
419
- GET /listings(.:format) listings#index
420
-
421
- POST /listings(.:format) listings#create
422
-
423
- GET /listings/new(.:format) listings#new
424
-
425
- GET /listings/:id/edit(.:format) listings#edit
426
-
427
- GET /listings/:id(.:format) listings#show
428
-
429
- PATCH /listings/:id(.:format) listings#update
430
-
431
- PUT /listings/:id(.:format) listings#update
432
-
433
- DELETE /listings/:id(.:format) listings#destroy
434
-
435
- manage_listing_basics GET /manage-listing/:id/basics(.:format) listings#basics
436
-
437
- manage_listing_description GET /manage-listing/:id/description(.:format) listings#description
438
-
439
- manage_listing_address GET /manage-listing/:id/address(.:format) listings#address
440
-
441
- manage_listing_price GET /manage-listing/:id/price(.:format) listings#price
442
-
443
- manage_listing_photos GET /manage-listing/:id/photos(.:format) listings#photos
444
-
445
- manage_listing_calendar GET /manage-listing/:id/calendar(.:format) listings#calendar
446
-
447
- manage_listing_bankaccount GET /manage-listing/:id/bankaccount(.:format) listings#bankaccount
448
-
449
- manage_listing_publish GET /manage-listing/:id/publish(.:format) listings#publish
450
-
451
- ```
349
+
350
+
351
+
352
+
353
+
354
+
355
+ ### 追記エラー
356
+
357
+ ```
358
+
359
+ ActiveRecord::StatementInvalid in Listings#show
360
+
361
+ Showing /Users/komorigasa/Desktop/Travelshare/app/views/listings/show.html.erb
362
+
363
+
364
+
365
+ Could not find table 'reservations'
366
+
367
+ Extracted source (around line #86):
368
+
369
+
370
+
371
+
372
+
373
+ 85 <div class="panel-body panel-real">
374
+
375
+ 86 <%= form_for [@listing, @listing.reservations.build] do |f| %>
376
+
377
+
378
+
379
+ ```

2

誤字

2018/01/08 16:28

投稿

komorigasa
komorigasa

スコア9

test CHANGED
File without changes
test CHANGED
@@ -72,7 +72,7 @@
72
72
 
73
73
  ルート、コントローラー、ビューの順で作っています。
74
74
 
75
- 0. 番号リスト
75
+
76
76
 
77
77
 
78
78
 

1

controllerのコードの追加

2018/01/08 16:13

投稿

komorigasa
komorigasa

スコア9

test CHANGED
File without changes
test CHANGED
@@ -262,6 +262,26 @@
262
262
 
263
263
  ```
264
264
 
265
+
266
+
267
+ ###reservation.rb
268
+
269
+ ```
270
+
271
+ class Resevation < ApplicationRecord
272
+
273
+ belongs_to :user
274
+
275
+ belongs_to :listing
276
+
277
+ end
278
+
279
+
280
+
281
+ ```
282
+
283
+
284
+
265
285
  ### listing.rb
266
286
 
267
287
  ```