質問編集履歴
3
誤字削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,7 +42,7 @@
|
|
42
42
|
|
43
43
|
def search
|
44
44
|
|
45
|
-
@book = GoogleBook.
|
45
|
+
@book = GoogleBook.instance.search(params[:keyword])
|
46
46
|
|
47
47
|
end
|
48
48
|
|
2
タイポしていたserchをsearchに変更しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,9 +16,9 @@
|
|
16
16
|
|
17
17
|
```View
|
18
18
|
|
19
|
-
<%= form_with(url:search_path,local: true, method: :get,class: "serch-form") do |search|%>
|
19
|
+
<%= form_with(url:search_path,local: true, method: :get,class: "search-form") do |search|%>
|
20
20
|
|
21
|
-
<%= search.text_field :keyword,
|
21
|
+
<%= search.text_field :keyword,placeholder: "本を探す", class: "search-input" %>
|
22
22
|
|
23
23
|
<%= search.submit "検索", class: "form-btn" %>
|
24
24
|
|
@@ -40,13 +40,15 @@
|
|
40
40
|
|
41
41
|
|
42
42
|
|
43
|
-
def serch
|
43
|
+
def search
|
44
44
|
|
45
|
-
@book = GoogleBook.instance.serch(params[:
|
45
|
+
@book = GoogleBook.new.instance.search(params[:keyword])
|
46
46
|
|
47
47
|
end
|
48
48
|
|
49
49
|
end
|
50
|
+
|
51
|
+
|
50
52
|
|
51
53
|
```
|
52
54
|
|
1
エラーメッセージの一部削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,13 +10,9 @@
|
|
10
10
|
|
11
11
|
![イメージ説明](7cc6980c0f316cbe95355902ce956353.png)
|
12
12
|
|
13
|
-
bookの中がnilで表示できないとエラーが出てしまいます。
|
14
13
|
|
15
14
|
|
16
|
-
|
17
|
-
|
15
|
+
**app/views/books/new.html.erb**
|
18
|
-
|
19
|
-
|
20
16
|
|
21
17
|
```View
|
22
18
|
|
@@ -58,7 +54,11 @@
|
|
58
54
|
|
59
55
|
APIの処理は別クラスで分けました
|
60
56
|
|
57
|
+
|
58
|
+
|
61
59
|
**lib/google_book.rb**
|
60
|
+
|
61
|
+
|
62
62
|
|
63
63
|
```
|
64
64
|
|