Forum: Ruby on Rails Return Rendering Controller In View

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Larsenmtl L. (Guest)
on 2006-04-05 18:41
I have a shared partial which could be rendered by two different
controllers.  Is there an easy way in the view to return which
controller rendered the partial?  I've tried using:

<%debug(params['controller'])%>

While that does return what I need it seems like a kludgy fit since
debug is not meant to be used for that.

Thanks,

LarsenMTL
Charlie B. (Guest)
on 2006-04-05 18:53
(Received via mailing list)
Try:

controller.controller_name
controller.action_name

** This was offered in response to a post of mine but I haven't tried it
yet.
Larsenmtl L. (Guest)
on 2006-04-05 18:56
Simple, clean and worked like a charm.  I knew I was missing something.

Thanks a lot.
This topic is locked and can not be replied to.