質問編集履歴

1

間違って記載

2018/11/29 15:41

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -250,54 +250,14 @@
250
250
 
251
251
  ```model.rb
252
252
 
253
+
254
+
253
- def self.search(search) #self.でクラスメソッドとしている
255
+ def self.updatable_attributes
254
-
255
- if search # Controllerから渡されたパラメータが!= nilの場合は、titleカラムを部分一致検索
256
+
256
-
257
- Post.where(
258
-
259
- ['company LIKE ?', "%#{company}%"],
260
-
261
- ['store LIKE ?', "%#{store}%"],
262
-
263
- ['owner LIKE ?', "%#{owner}%"],
264
-
265
- ['kana LIKE ?', "%#{kana}%"],
266
-
267
- ['tel LIKE ?', "%#{tel}%"],
268
-
269
- ['tel2 LIKE ?', "%#{tel2}%"],
270
-
271
- ['fax LIKE ?', "%#{fax}%"],
272
-
273
- ['industry LIKE ?', "%#{industry}%"],
274
-
275
- ['mail LIKE ?', "%#{mail}%"],
276
-
277
- ['url LIKE ?', "%#{url}%"],
278
-
279
- ['people LIKE ?', "%#{people}%"],
280
-
281
- ['address LIKE ?', "%#{address}%"],
282
-
283
- ['statu LIKE ?', "%#{statu}%"],
284
-
285
- ['time LIKE ?', "%#{time}%"],
286
-
287
- ['comment LIKE ?', "%#{comment}%"],
288
-
289
- ['created_at LIKE ?', "%#{updated_at}%..today"],
257
+ ["company", "store", "owner","kana", "tel", "tel2","fax", "industry", "address", "mail", "url", "people", "history"]
290
-
291
- )
258
+
292
-
293
- else
294
-
295
- Post.all #全て表示。
296
-
297
- end
259
+ end
298
-
299
- end
260
+
300
-
301
-
261
+
302
262
 
303
263
  ```