Class: Envoy::ConversationsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Envoy::ConversationsController
- Defined in:
- app/controllers/envoy/conversations_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/envoy/conversations_controller.rb', line 11 def create @conversation = Conversation.new(conversation_params) @conversation.actor = envoy_current_actor @conversation.model_id ||= Envoy.config.default_model @conversation.provider = Envoy.config.provider.to_s if @conversation.save redirect_to conversation_path(@conversation) else render :new, status: :unprocessable_entity end end |
#index ⇒ Object
3 4 5 |
# File 'app/controllers/envoy/conversations_controller.rb', line 3 def index @conversations = Conversation.where(actor: envoy_current_actor).order(created_at: :desc) end |
#new ⇒ Object
7 8 9 |
# File 'app/controllers/envoy/conversations_controller.rb', line 7 def new @conversation = Conversation.new end |
#show ⇒ Object
23 24 25 |
# File 'app/controllers/envoy/conversations_controller.rb', line 23 def show @conversation = Conversation.where(actor: envoy_current_actor).find(params[:id]) end |