views:

109

answers:

1

Hi guys,

In runtime we can get the current controller and current action names by controller_name and action_name methods like wise,

I want to get all the remaining controllers and action names and models too if possible..

Any rails method available to get all the controller names and the action names in application controller.

A: 
@table_names =  ActiveRecord::Base.connection.tables
    @model_names = Array.new
    @model_names.each do |table_to_model|
      @model_names = @model_names.insert(@model_names.length,table_to_model.camelize.singularize) unless table_to_model.blank?
    end

This is how you get all Model name

Thanks alot ..By this way is it possible to get controller names and action and method names ...Thanks in Advance..Regards,Ramanaa Selvaa
Ramanavel