# controller:
def show_all_models
# require all of your models so they get loaded
Dir.glob(RAILS_ROOT + '/app/models/*.rb').each { |file| require
file }
# find all subclasses of ActiveRecord
@all_models = Object.subclasses_of(ActiveRecord::Base)
end
# view:
<ul>
<% @all_models.each do |model| %>
<li><%= model %></li>
<% end %>
</ul>
if you are using ActiveRecordStore there is probably a model in there
for that as well. if you don't want to display that one, remove it
inside your controller.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---