Class: DrawErd::DiagramController

Inherits:
ApplicationController show all
Defined in:
app/controllers/draw_erd/diagram_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/draw_erd/diagram_controller.rb', line 3

def index
  title = 'erd'
  path = 'draw-erd'
  @image_file = File.join(path, "#{title}.png")

  @domains = []
  @domains = params['schemas'].keys if params.key?('schemas')

  diagram = DrawErd::Diagram.new(File.join('public', 'images', path))
  diagram.create(title, @domains)

  @schemas = DrawErd::Diagram.schemas
end