質問編集履歴
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,36 +42,6 @@
|
|
42
42
|
|
43
43
|
end
|
44
44
|
|
45
|
-
```
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
```View
|
50
|
-
|
51
|
-
<h1>Titles</h1>
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
<%= form_for(@title) do |f| %>
|
56
|
-
|
57
|
-
<%= f.label :title, 'タイトル' %>
|
58
|
-
|
59
|
-
<%= f.text_field :title %>
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
<%= f.submit '検索' %>
|
64
|
-
|
65
|
-
<% end %>
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<%= @result %>
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
45
|
|
76
46
|
|
77
47
|
def create
|
@@ -114,6 +84,40 @@
|
|
114
84
|
|
115
85
|
|
116
86
|
|
87
|
+
```View
|
88
|
+
|
89
|
+
<h1>Titles</h1>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<%= form_for(@title) do |f| %>
|
94
|
+
|
95
|
+
<%= f.label :title, 'タイトル' %>
|
96
|
+
|
97
|
+
<%= f.text_field :title %>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<%= f.submit '検索' %>
|
102
|
+
|
103
|
+
<% end %>
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<%= @result %>
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
```
|
118
|
+
|
119
|
+
|
120
|
+
|
117
121
|
scaffoldで簡易的に作っています
|
118
122
|
|
119
123
|
|
1
文房の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -68,7 +68,53 @@
|
|
68
68
|
|
69
69
|
<%= @result %>
|
70
70
|
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
def create
|
78
|
+
|
79
|
+
@title = Title.new(title_params)
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
respond_to do |format|
|
84
|
+
|
85
|
+
if @title.save
|
86
|
+
|
87
|
+
format.html { redirect_to @title, notice: 'Title was successfully created.' }
|
88
|
+
|
89
|
+
format.json { render :show, status: :created, location: @title }
|
90
|
+
|
91
|
+
else
|
92
|
+
|
93
|
+
format.html { render :new }
|
94
|
+
|
95
|
+
format.json { render json: @title.errors, status: :unprocessable_entity }
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
def title_params
|
108
|
+
|
109
|
+
params.require(:title).permit(:title)
|
110
|
+
|
111
|
+
end
|
112
|
+
|
71
113
|
```
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
scaffoldで簡易的に作っています
|
72
118
|
|
73
119
|
|
74
120
|
|