Pregunta

Given:

  • A FooController with a bar action
  • An ActionView template handler for the custom extension
  • A template at app/views/foo/bar.custom

Is there a way to make Rails render that template only for HTML requests without renaming the template to bar.html.custom?

¿Fue útil?

Solución

I figured out how to do this using a custom ActionView::Responder. See https://github.com/netzpirat/haml_coffee_assets/issues/80 for details of why this was needed and how I solved it.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top