Skip to content
Various ways to handle multi-model forms in Rails.
JavaScript Ruby
Pull request Compare This branch is 3 commits ahead, 8 commits behind ryanb:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app
config
db
doc
public
script
test
.gitignore
LICENSE
README.rdoc
Rakefile

README.rdoc

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
Something went wrong with that request. Please try again.