Permalink
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (14 sloc) 1018 Bytes

Complex Form Examples

This branch is a solution for the multi-model form problem using the latest accepts_nested_attributes_for available in Rails 2.3.

This branch makes the templates location independent (in other branches they were created in the context of another form). To demonstrate this in practice, Steps are polymorphically owned, either by a Task or an Assignment.

This requires adding a few more attributes in the html.

The link to add a template now requires a data-target which should be a css selector that can be used to identify the target container that the template will be appended into.

The targeted container must have a data-context attribute that specifies the name (e.g., “project[2]”) that encloses the template.

Once you clone this repository, just run the migrations and start up the server to try it out.

rake db:migrate
script/server

See the branches for alternative solutions. Here's how to clone a remote branch.

git checkout -b deep origin/deep