Class: Conversations::MessagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Conversations::MessagesController
- Includes:
- ApplicationHelper
- Defined in:
- app/controllers/conversations/messages_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/conversations/messages_controller.rb', line 5 def create @user = User.find(params[:user_id]) @conversation = UserConversation.find params[:conversation_id] @message = @conversation.conversation..build params[:conversations_message] @message.user = @user if @message.save redirect_to user_conversation_path(@user, @conversation) else render template: 'conversations/user_conversations/show' end end |