Forum: Ruby on Rails .columns refresh

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ryan (Guest)
on 2007-04-20 03:42
I'm trying to iterate through all tables and fields in a mySQL database.

<% for i in Model.connection.tables %>
  Table Name: <%= i %><br />

        <% Model.set_table_name i %>

  <% for j in Model.columns %>
    Field Name: <%= %><br />
  <% end %>

<% end %>

I'm using: Model.connection.tables to get an array of table names, and I
change the table_name in a Model, then try to iterate through it's

However... it seems that Model.columns is only calculated once, because
I'm only getting the fields of the 1st table to show up under every
table name.

I've tried looking at the reload()[1], with no luck


Any ideas???

Thank You,

This topic is locked and can not be replied to.