Howto: List the actions inside a controller
Posted by Sandro Paganotti in
Ruby on Rails -
comments are closed
One of the most greatest Ruby feature is reflection; it let you inspect your classes and retrive informations about them. For example if you need to know the name of all the actions inside a controller you can just wrote this line:
MyController.instance_methods(false)
And… if you are curious, dump the array returned from
MyController.methods
You will find a lot of useful methods !
Sandro.


Comments
Marcio
Posted on February 09
Sandro Paganotti
Posted on February 09
John
Posted on February 09
Alex
Posted on February 11