Skip to content
scambra edited this page Sep 14, 2010 · 9 revisions

If you want override a subform template for a controller, and use this template in all views which include a subform of that controller, you must put a _subform partial in app/views/<controller>/ directory (e.g. app/views/comments/ for the CommentsController and it will be used instead of the usual horizontal subform in all controllers with include a subform of CommentsController).

You can look at _horizontal_subform.rhtml in frontends/defaults/views/ directory of ActiveScaffold for an example of a subform partial. Don’t forget use the scope parameter to name your fields or the model in subform won’t be created/updated.

You can’t call to render :super in a subform override.

Clone this wiki locally