質問編集履歴
1
customer モデルの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -118,6 +118,38 @@
|
|
118
118
|
|
119
119
|
|
120
120
|
|
121
|
+
・ post customer モデル
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
class Customer < ApplicationRecord
|
126
|
+
|
127
|
+
# Include default devise modules. Others available are:
|
128
|
+
|
129
|
+
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
|
130
|
+
|
131
|
+
devise :database_authenticatable, :registerable,
|
132
|
+
|
133
|
+
:recoverable, :rememberable, :validatable
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
ratyrate_rater
|
138
|
+
|
139
|
+
has_many :posts, dependent: :destroy
|
140
|
+
|
141
|
+
has_many :post_comments, dependent: :destroy
|
142
|
+
|
143
|
+
has_many :favorites, dependent: :destroy
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
end
|
150
|
+
|
151
|
+
|
152
|
+
|
121
153
|
・ルーティング 設定
|
122
154
|
|
123
155
|
resources :posts, only: [:new, :create, :index, :show] do
|