How to test for controller


#1

I have a side navigation that i want to change based on the controller.
How would i test for this in .rhtml. for example lets say i have an
admin controller.

Example

<% if @controller = admin %> ---- What actually would this syntax be?
<% @categories.each do |category| %>
<%= link_to category.name, :action => “list_by_cat”, :id =>
category.id %>

<% end %>

What is the variable name to get at the current controller?

Thanks,
Beau


#2

On 12/2/05, Beau O’Hara removed_email_address@domain.invalid wrote:

<% end %>

What is the variable name to get at the current controller?

<% if controller.controller_name == ‘admin’ -%>


rick
http://techno-weenie.net