trabajo-afectivo/app/controllers/chats_controller.rb

38 lines
734 B
Ruby
Raw Permalink Normal View History

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
2015-11-16 10:44:13 +00:00
class ChatsController < ApplicationController
prepend_before_action { authentication_check && authorize! }
2015-11-16 10:44:13 +00:00
def index
chat_ids = []
assets = {}
Chat.order(:id).each do |chat|
2015-11-16 10:44:13 +00:00
chat_ids.push chat.id
assets = chat.assets(assets)
end
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,
2015-11-16 10:44:13 +00:00
}
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