7 8 9 10 11 12 13 14
# File 'app/controllers/erd_map/erd_map_controller.rb', line 7 def index if File.exist?(ErdMap::MAP_FILE) render html: File.read(ErdMap::MAP_FILE).html_safe else pid = spawn("rails erd_map") Process.detach(pid) end end
16 17 18 19 20 21
# File 'app/controllers/erd_map/erd_map_controller.rb', line 16 def update File.delete(ErdMap::MAP_FILE) if File.exist?(ErdMap::MAP_FILE) pid = spawn("rails erd_map") Process.detach(pid) redirect_to erd_map.root_path, status: :see_other end