List all Models, Controllers, Views and Tests

Hi All,

List all Models, Controllers, Views and Tests

I am writing a plug in and I need to list all the models and their
related
controllers, views and any unit test scripts for models, functional test
scripts for controllers and integration test scripts for views.

How would I be able to get this information and display it using Rails?

Kind Regards

Gurdipe

Hello

in ur app, get models

Dir[‘app/models/.rb’].map {|f| File.basename(f,
'.
’).camelize.constantize }
def get_model_names_sub
Module.constants.select do |constant_name|
constant = eval constant_name
if not constant.nil? and constant.is_a? Class and
constant.superclass == ActiveRecord::Base
constant
end
end
end

2012/4/6 Gurdipe D. [email protected]

I am writing a plug in and I need to list all the models and their related

You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/pKL5k9z3e3cJ.
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.


att,

Rogerio

A complicao se descomplica na mesma proporo que fazemos os ns se
desatarem ao tecer o conhecimento do saber.

Hi Rogerio,

Thanks for the awesome brilliant reply, its been a great help to me.

Gurdipe