我想要为我的数据库中的所有表创建按钮(使用鞋子)。
我是一个初学者,这是我的第一个GUI项目‘库存管理’,我使用鞋库在Ruby,并希望存储和管理数据在MySql2与Ruby。我输入了一些代码,但不起作用。
路径/main.rb
require 'mysql2'
require 'green_shoes'
client = Mysql2::Client.new (host: "localhost",username: "root", password: "xyz", database: "Ruby")
Shoes.app do
components = client.query("SHOW TABLES")
components.each do |item|
button item
end
end`一事无成。
发布于 2017-12-17 08:54:35
您可以从information_schema查询它们。
components = client.query("SELECT table_name FROM information_schema.tables")https://stackoverflow.com/questions/47853556
复制相似问题