Current controller

Hello railists,

I have a list of news headers on my index page. I would like to hide
this list if current controller is ‘news’.
I put to main/index.rhtml
"<% unless @controller == “news” %> list here news headers <% end %>

. This doesn’t work.

So, the question is how to get current controller name in template ?

Thank You!


Emin H. wrote:


thank you, it works!

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