質問編集履歴
1
編集・追記依頼の補足
title
CHANGED
File without changes
|
body
CHANGED
@@ -91,5 +91,34 @@
|
|
91
91
|
|
92
92
|
end
|
93
93
|
```
|
94
|
+
初めてこの質問をサービスを使うので、至らない点がありますが、ご回答お待ちしております。
|
95
|
+
### 補足
|
96
|
+
```ruby
|
97
|
+
# == Schema Information
|
98
|
+
#
|
99
|
+
# Table name: boards
|
100
|
+
#
|
101
|
+
# id :bigint not null, primary key
|
102
|
+
# body :text(65535)
|
103
|
+
# city :string(255)
|
104
|
+
# image :string(255)
|
105
|
+
# name :string(255)
|
106
|
+
# created_at :datetime not null
|
107
|
+
# updated_at :datetime not null
|
108
|
+
#
|
109
|
+
class Board < ApplicationRecord
|
110
|
+
validates :name, presence: true, length: { maximum: 20 }
|
111
|
+
validates :body, presence: true, length: { maximum: 1000 }
|
112
|
+
end
|
113
|
+
```
|
94
114
|
|
95
|
-
|
115
|
+
```table
|
116
|
+
--------------------------+----------------------------+----------------------------+
|
117
|
+
| id | name | city | body | image | created_at | updated_at |
|
118
|
+
+----+-----------------------------+-----------------------------------------------------------+-----------------+----------------------------------------------------------+----------------------------+----------------------------+
|
119
|
+
| 3 | Fate/stay night | 兵庫県神戸市中央区北野町3丁目13−3 | 風見鶏の館 | #<ActionDispatch::Http::UploadedFile:0x00007fac59b7c2a0> | 2020-05-08 14:58:50.611866 | 2020-05-08 14:58:50.611866 |
|
120
|
+
| 5 | ひぐらしのなく頃に | 岐阜県大野郡白川村荻町1086 白川郷 | 圭一の家 | #<ActionDispatch::Http::UploadedFile:0x00007fac59b6c080> | 2020-05-13 16:29:52.713192 | 2020-05-13 16:29:52.713192 |
|
121
|
+
+----+-----------------------------+-----------------------------------------------------------+-----------------+----------------------------------------------------------+----------------------------+----------------------------+
|
122
|
+
|
123
|
+
```
|
124
|
+
補足を加えました。上がBoard classで下がBoardテーブルです。
|