Class: Observ::ChatsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Observ::ChatsController
- Defined in:
- app/controllers/observ/chats_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/observ/chats_controller.rb', line 15 def create @chat = ::Chat.new(params_chat) # Set prompt name from agent if applicable set_prompt_info_from_agent if @chat.save redirect_to chat_path(@chat), notice: "Chat was successfully created." else render :new, status: :unprocessable_content end end |
#index ⇒ Object
5 6 7 8 9 |
# File 'app/controllers/observ/chats_controller.rb', line 5 def index @chats = ::Chat.order(created_at: :desc) .page(params[:page]) .per(Observ.config.pagination_per_page) end |
#new ⇒ Object
11 12 13 |
# File 'app/controllers/observ/chats_controller.rb', line 11 def new @chat = ::Chat.new end |
#show ⇒ Object
28 29 30 |
# File 'app/controllers/observ/chats_controller.rb', line 28 def show = @chat..build end |