Building Ruby on Rails App with an existing Mysql db

前端 未结 3 1268
栀梦
栀梦 2021-01-15 12:21

I have a Mysql database with a large amount of data and tables. But i need to know how to use this Mysql data in the my new rails application. I\'ve been learning Rails from

3条回答
  •  萌比男神i
    2021-01-15 12:59

    If you need to import that data from your current database into the one for your app, I recommend using Sequel Pro. It's a great GUI for MySQL. You can use it to export the database you want, say as a .csv file, and import it into your new database.

    Regarding your migration, running a scaffold and running rake db:migrate will just set your database up; it won't add any data. So here, you've set it to create your products table, and specified the data types for its attributes.

    But in order to get data in there, you can only do that via a form with your application, or by importing data.

提交回复
热议问题