Class: TurboChat::ChatMessagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- TurboChat::ChatMessagesController
- Defined in:
- app/controllers/turbo_chat/chat_messages_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
13 14 15 16 17 18 |
# File 'app/controllers/turbo_chat/chat_messages_controller.rb', line 13 def create return respond_to_clear_signal_request if clear_signal_request? @chat_message.save ? : end |
#index ⇒ Object
9 10 11 |
# File 'app/controllers/turbo_chat/chat_messages_controller.rb', line 9 def index @chat_messages = @chat. end |
#update ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/turbo_chat/chat_messages_controller.rb', line 20 def update updated = @chat_message.update() if turbo_stream_request? return (force_edit_open: !updated, status: updated ? :ok : :unprocessable_entity) end if updated redirect_to chat_path(@chat), notice: "Message updated" else redirect_to chat_path(@chat), alert: @chat_message.errors..to_sentence end end |