ensl.org/app/controllers/api/v1/servers_controller.rb

22 lines
418 B
Ruby
Raw Permalink Normal View History

2015-08-01 15:20:49 +00:00
class Api::V1::ServersController < Api::V1::BaseController
def index
render json: { servers: active_servers }
end
private
def active_servers
2015-08-27 10:58:30 +00:00
Server.active.map do |s|
2015-08-01 15:20:49 +00:00
{
id: s.id,
2015-08-27 10:58:30 +00:00
name: s.name,
2015-08-01 15:20:49 +00:00
description: s.description,
dns: s.dns,
ip: s.ip,
port: s.port,
password: s.password,
category_id: s.category_id
}
end
end
end