Hi
Is there a way to find out in a partial, rendered in all views, what
controller/action rendered the partial?
Cheers
Mark
Hi
Is there a way to find out in a partial, rendered in all views, what
controller/action rendered the partial?
Cheers
Mark
Mark Goddard wrote:
Hi
Is there a way to find out in a partial, rendered in all views, what
controller/action rendered the partial?Cheers
Mark
Figured it out
<%- if controller.controller_name == “foo” -%>
bar
<%- end -%>
<%- if controller.action_name == “foo” -%>
bar
<%- end -%>
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs