trabajo-afectivo/app/controllers/chats_controller.rb

38 lines
741 B
Ruby
Raw Normal View History

2016-10-19 03:11:36 +00:00
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
2015-11-16 10:44:13 +00:00
class ChatsController < ApplicationController
prepend_before_action { authentication_check(permission: 'admin.chat') }
2015-11-16 10:44:13 +00:00
def index
chat_ids = []
assets = {}
2016-06-30 20:04:48 +00:00
Chat.order(:id).each { |chat|
2015-11-16 10:44:13 +00:00
chat_ids.push chat.id
assets = chat.assets(assets)
}
2015-11-25 22:24:08 +00:00
setting = Setting.find_by(name: 'chat')
assets = setting.assets(assets)
2015-11-16 10:44:13 +00:00
render json: {
chat_ids: chat_ids,
assets: assets,
}
end
def show
model_show_render(Chat, params)
end
def create
model_create_render(Chat, params)
end
def update
model_update_render(Chat, params)
end
def destroy
model_destroy_render(Chat, params)
2015-11-16 10:44:13 +00:00
end
2015-11-16 10:44:13 +00:00
end