Cargue dinámicamente el parcial basado en los rieles de acción del controlador

I have a series of different blocks of HTML that i'd like to load into my partial "_right_column" based on the controller and action. What is the best way to conditionally load a partial based on the current controller & action, and where should this check occur?

preguntado el 01 de julio de 12 a las 22:07

1 Respuestas

Puedes comprobar controller.controller_name y controller.action_name en tu opinión.

Depending on how big the particular switch statement is, you will probably want to put it in a helper method in application_helper rather than into your partial _right_column.

Respondido 01 Jul 12, 23:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.