简体   繁体   中英

New table not displaying in rails_admin after created using rails g scaffold

I'm new to RoR and have only done light scripting and VB, so I'm sorry for the lack of knowledge.

I have used the Rails_admin gem to add the admin feature to my ruby app. I then use rails to generate scaffold. Ran rake to bring my db to the latest version. It creates the new table which I can access through http://localhost:3000/phonenumbers , but when I go to the http://localhost:3000/admin only my Users table is displayed. Does rails_admin not automatically recognize all tables in the database?

Have you tried restarting your server?

I experienced a similar problem trying to add a new table, and rails admin on the same table, in one deploy. This was because rails admin initializes routes for a table but the migration had not run yet.

I had the same issue, I was so focused on my migration that i forgot to add the model. You have to restart the rails app so Rails_Admin will pick up the new model. It uses the model to derive the structure not the database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM