How to test for controller

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

On 12/2/05, Beau O’Hara [email protected] wrote:

<% end %>

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

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


rick
http://techno-weenie.net

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs