Answering the following post that I could not (did not know how to) re-
open:
I have been working on getting a list of all actions in every
controller of my application to automate certain process. I found a
couple of links with some useful information that lead me to write
this code:
# This produces an array with subclasses names.
ApplicationController.subclasses.sort.each do |subclass|
# This creates a new instance of a controller based on the
subclass name.
controller = subclass.constantize.new
# This creates an anonymous singleton class in which I declare
# a public method that accesses private method 'action_methods',
# which returns the controller actions
class << controller
def my_action_methods
action_methods
end
end
I hope this helps somebody.