public
Description:
Home | Edit | New

Subform Overrides

If you want to 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_layout}_subform.html.erb partial in app/views/<controller>/ directory (e.g. app/views/comments/ for the CommentsController and it will be used instead of the layout which comes with ActiveScaffold in all controllers with include a subform of CommentsController).

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

Last edited by scambra, Wed Apr 29 03:38:52 -0700 2009
Home | Edit | New
Versions: