Sha256: 119b332714f6ee1ce5e56a1de86887132b086528dd3dc74b2dc073e4d6a98086

Contents?: true

Size: 576 Bytes

Versions: 4

Compression:

Stored size: 576 Bytes

Contents

class Chatty::AdminChatsController < Chatty::ApplicationController
  before_filter :set_chat, :only => [:handle, :show]
  
  def index
    @ransack_params = params[:q] || {}
    @ransack = Chatty::Chat.ransack(@ransack_params)
    @chats = @ransack.result.order(:id).reverse_order
  end
  
  def show
  end
  
  def handle
    @chat.handled = true
    @chat.save!
    @chat.create_activity :key => "chatty/chat.handled", :owner => current_user
    
    redirect_to admin_chat_path(@chat)
  end
  
private
  
  def set_chat
    @chat = Chatty::Chat.find(params[:id])
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chatty-0.0.4 app/controllers/chatty/admin_chats_controller.rb
chatty-0.0.3 app/controllers/chatty/admin_chats_controller.rb
chatty-0.0.2 app/controllers/chatty/admin_chats_controller.rb
chatty-0.0.1 app/controllers/chatty/admin_chats_controller.rb