controller.controller_name
http://api.rubyonrails.com/classes/ActionController/Base.html#M000176
On 3/25/06, Firstname Secondname <mzilenas@gmail.com>
wrote:>
> 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!
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060325/60fd2bdf/attachment.html