Hi, Given a controller such as Maintenance::ProductsController, is there a way to obtain the module section ''Maintenance'' within a view. I am planning to highlight the maintenance option from a common menu whenever a controller from the Maintenance module is used. Thanks, Andrew. -- Posted via http://www.ruby-forum.com/.
On 7-Jul-06, at 11:55 AM, Andrew Edwards wrote:> Hi, > > Given a controller such as Maintenance::ProductsController, is there a > way to obtain the module section ''Maintenance'' within a view. > > I am planning to highlight the maintenance option from a common menu > whenever a controller from the Maintenance module is used. >There may be cleaner ways to do it but this ought to work: controller.class.name.split(''::'').first Regards, Trevor -- Trevor Squires http://somethinglearned.com