Rails: How to list database tables/objects using the Rails console? -


i wondering if list/examine databases/objects available in rails console. know can see them using other tools, curious. thanks.

you seeking:

activerecord::base.connection.tables 

and

activerecord::base.connection.table_structure("projects") 

you should wrap them in shorter syntax inside .irbrc.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -