-
Notifications
You must be signed in to change notification settings - Fork 332
Subform Overrides
scambra edited this page Sep 14, 2010
·
9 revisions
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.