Return Rendering Controller In View

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

Try:

controller.controller_name
controller.action_name

** This was offered in response to a post of mine but I haven’t tried it
yet.

Simple, clean and worked like a charm. I knew I was missing something.

Thanks a lot.

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