scinote-web/app/controllers/client_api/configurations_controller.rb

24 lines
510 B
Ruby
Raw Normal View History

2017-11-02 20:23:57 +08:00
module ClientApi
class ConfigurationsController < ApplicationController
def about_scinote
respond_to do |format|
format.json do
render json: {
scinoteVersion: Scinote::Application::VERSION,
addons: list_all_addons
}, status: :ok
end
end
end
private
def list_all_addons
Rails::Engine.subclasses
.select { |c| c.name.start_with?('Scinote') }
.map(&:parent)
end
end
end