質問編集履歴
5
補足
test
CHANGED
File without changes
|
test
CHANGED
@@ -223,3 +223,39 @@
|
|
223
223
|
<% end %>
|
224
224
|
|
225
225
|
```
|
226
|
+
|
227
|
+
### ログ
|
228
|
+
|
229
|
+
```ここに言語を入力
|
230
|
+
|
231
|
+
Started POST "/circleposts" for 126.227.240.207 at 2021-04-27 14:19:34 +0000
|
232
|
+
|
233
|
+
Cannot render console from 126.227.240.207! Allowed networks: 126.227.199.43, 127.0.0.0/127.255.255.255, ::1
|
234
|
+
|
235
|
+
(1.8ms) SELECT sqlite_version(*)
|
236
|
+
|
237
|
+
(0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
|
238
|
+
|
239
|
+
Processing by CirclepostsController#create as HTML
|
240
|
+
|
241
|
+
Parameters: {"authenticity_token"=>"pgdArkzFtgJKP1AYL0hjpJTnRBpCaQL47awdeH/E1svA88nIqY/RrdXLROzMzH7BW6L9YRcL4aA8rGPx26PkLg==", "circlepost"=>{"content"=>"d"}, "commit"=>"投稿"}
|
242
|
+
|
243
|
+
User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
|
244
|
+
|
245
|
+
↳ app/helpers/sessions_helper.rb:18:in `current_user'
|
246
|
+
|
247
|
+
Circle Load (0.8ms) SELECT "circles".* FROM "circles" WHERE "circles"."id" IS NULL LIMIT ? [["LIMIT", 1]]
|
248
|
+
|
249
|
+
↳ app/controllers/circleposts_controller.rb:7:in `create'
|
250
|
+
|
251
|
+
Completed 422 Unprocessable Entity in 424ms (ActiveRecord: 5.1ms | Allocations: 207665)
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
ActiveRecord::RecordInvalid (バリデーションに失敗しました: Circleを入力してくださ
|
260
|
+
|
261
|
+
```
|
4
補足
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
3
viewの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -147,3 +147,79 @@
|
|
147
147
|
ユーザーとグループに関連づけています。※ユーザーとグループ側にも関連付けしています。
|
148
148
|
|
149
149
|
```
|
150
|
+
|
151
|
+
```ここに言語を入力
|
152
|
+
|
153
|
+
/app/views/circles/postlist.html.erb
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<% provide(:title, 'postlist') %>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<h3 class="circle-name"><%= @circle.name %></h3>
|
162
|
+
|
163
|
+
<div class="postlist">
|
164
|
+
|
165
|
+
<% if @circle.circle_user?(current_user) %>
|
166
|
+
|
167
|
+
<section class="circlepost_form">
|
168
|
+
|
169
|
+
<%= render 'shared/circlepost_form' %>
|
170
|
+
|
171
|
+
</section>
|
172
|
+
|
173
|
+
<% end %>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<% if @circle.circleposts.any? %>
|
178
|
+
|
179
|
+
<ol class="circleposts">
|
180
|
+
|
181
|
+
<%= render @circleposts %>
|
182
|
+
|
183
|
+
</ol>
|
184
|
+
|
185
|
+
<div class="page">
|
186
|
+
|
187
|
+
<%= will_paginate @circleposts, { :previous_label => '< 前へ', :next_label => '次へ >' } %>
|
188
|
+
|
189
|
+
</div>
|
190
|
+
|
191
|
+
<% end %>
|
192
|
+
|
193
|
+
</div>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
```
|
198
|
+
|
199
|
+
```ここに言語を入力
|
200
|
+
|
201
|
+
/app/views/shared/_circlepost_form.html.erb
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
<%= form_with(model: @circlepost, local: true) do |b| %>
|
206
|
+
|
207
|
+
<%= render 'shared/error_messages_second', object: b.object %>
|
208
|
+
|
209
|
+
<div class="field">
|
210
|
+
|
211
|
+
<%= b.text_area :content, placeholder: "(例) 活動時間を変更したので確認してください!" %>
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
<%= b.submit "投稿", class: "btn btn-warning" %>
|
216
|
+
|
217
|
+
<span class="image">
|
218
|
+
|
219
|
+
<%= b.file_field :image, accept: "image/jpeg,image/gif,image/png" %>
|
220
|
+
|
221
|
+
</span>
|
222
|
+
|
223
|
+
<% end %>
|
224
|
+
|
225
|
+
```
|
2
補足
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
---
|
24
24
|
|
25
|
-
これはルートに問題があるのかコントローラーに問題があるのかわかりません。
|
25
|
+
これはルートに問題があるのかコントローラーに問題があるのかわかりません。ルートやコントローラーをいじってみても分からなかったので、どういったように変更すれば良いか教えていただきたいです。
|
26
26
|
|
27
27
|
|
28
28
|
|
1
補足
test
CHANGED
File without changes
|
test
CHANGED
@@ -142,4 +142,8 @@
|
|
142
142
|
|
143
143
|
belongs_to :user
|
144
144
|
|
145
|
+
|
146
|
+
|
147
|
+
ユーザーとグループに関連づけています。※ユーザーとグループ側にも関連付けしています。
|
148
|
+
|
145
149
|
```
|