質問編集履歴
2
試したことを追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -31,5 +31,13 @@
|
|
31
31
|
|
32
32
|
```
|
33
33
|
|
34
|
+
## 試したこと
|
35
|
+
・present?を使う
|
36
|
+
scopeの下部を
|
37
|
+
```
|
38
|
+
{ asset_name: search_name.present? ? "%#{search_name}%" : "", industry_id: search_name.present? ? "#{industry_id}" : "" }
|
39
|
+
```
|
40
|
+
この場合でも``を検索してしまい、結果がゼロ件になってしまう。
|
41
|
+
|
34
42
|
## 環境
|
35
43
|
Rails 6.0
|
1
不必要な情報の削除
title
CHANGED
File without changes
|
body
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
|
28
28
|
items_controller.rb
|
29
29
|
```
|
30
|
-
@items = @items.
|
30
|
+
@items = @items.name_and_id_search_in_items_or_masters(index_search_params[:search_name],index_search_params[:search_id])
|
31
31
|
|
32
32
|
```
|
33
33
|
|