質問編集履歴
2
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -121,12 +121,10 @@
|
|
121
121
|
```
|
122
122
|
|
123
123
|
```jbuilder
|
124
|
-
json.array! @messages do |message|
|
125
124
|
json.id @message.id
|
126
125
|
json.room_id @message.room_id
|
127
126
|
json.user_id @message.user_id
|
128
127
|
json.content @message.content
|
129
|
-
end
|
130
128
|
```
|
131
129
|
|
132
130
|
```view
|
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -9,7 +9,6 @@
|
|
9
9
|
if Entry.where(:user_id => current_user.id, :room_id => params[:message][:room_id]).present?
|
10
10
|
@message = Message.create(params.require(:message).permit(:user_id, :content, :room_id).merge(:user_id => current_user.id))
|
11
11
|
redirect_to :action => "show", :controller=>"rooms",:id => @message.room_id
|
12
|
-
format.json
|
13
12
|
else
|
14
13
|
redirect_back(fallback_location: root_path)
|
15
14
|
end
|