Various ways to handle multi-model forms in Rails.
Ruby JavaScript
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 18 commits ahead, 8 commits behind ryanb:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
doc
lib/fixture_extractor
public
script
test
vendor/plugins
.gitignore
.gitmodules
LICENSE
README.rdoc
Rakefile

README.rdoc

FixtureExtractor Example

This rails app is a simple project management tool used to demonstrate the nested form capabilities in Rails. It contains 4 model classes: Project, Task, Assignment, and Step. It has a sqlite deveopment database with 4 projects pre-populated. To see the FxitureExtractor demo, checkout the project:

git clone git://github.com/brewski/fixture_extractor_examples.git
cd fixture_extractor_examples
git submodule init
git submodule update

start the server:

./script/server

And browse to localhost:3000/. From here you can see all the projects in the development database. To run the extractor:

rake db:fixtures:extract

The list of fixtures extracted in the above rake task is defined in test/fixtures.rb:

map_fixtures do |map|
  map.project 'Clean up our Streets', :with_tasks_for_superheros

  map.assignment 'Superman', :owned_by_hero
  map.assignment 'Brian', :owned_by_brian

  map.task 'Add Pork', :for_a_sleezy_politian
end