How to know the current Controller


#1

How can I get in the …\layouts\application.rhtml the “name” of the
current Controller?

//I need to set the var page_id:

<% @page_id = “…current_controler”%>

    //to build correctly the menu

<%= menu_builder(@page_id) %>

Thanks


#2

This is my first response…so take it for what it’s worth :wink:

<%= controller.controller_name %>

or

<% @page_id = controller.controller_name %>


#3

<%= controller.controller_name %>


#4

Scott Caldwell wrote:

This is my first response…so take it for what it’s worth :wink:

<%= controller.controller_name %>

or

<% @page_id = controller.controller_name %>

It Works,
thank You very much for You help


#5

No problem…glad to give a tiny bit back…

-Scott