Class: Vdb::ErdController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Vdb::ErdController
- Defined in:
- app/controllers/vdb/erd_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/controllers/vdb/erd_controller.rb', line 7 def index @database = valid_databases.key?(params[:database]) ? params[:database] : valid_databases.keys.first schema = read_schema(@database) @initial_graph = Vdb::SchemaToGraph.call(schema).to_json @databases = valid_databases.keys @title = Vdb.config.title end |
#parse ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/controllers/vdb/erd_controller.rb', line 15 def parse schema = params[:schema].to_s graph = Vdb::SchemaToGraph.call(schema) render json: graph rescue StandardError => e render json: { error: e. }, status: :unprocessable_entity end |