Skip to content
a small Rails application demonstrating nested forms with cocoon and simple_form
Branch: master
Clone or download
nathanvda Merge pull request #13 from mayordwells/master
Explictly state migration version number
Latest commit 27ee084 May 17, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Fix associations for rails 5 Jan 15, 2017
config Switch to latest version of bootstrap + simple-form. Apr 7, 2015
db get rid of ActiveRecord::Migration error - Directly inheriting from A… May 17, 2018
doc initial commit Feb 9, 2011
lib Updated to new bootstrap/simple-form. Nov 13, 2014
public Cleaned up unused js. Oct 9, 2011
script initial commit Feb 9, 2011
spec Update test-suite Jan 15, 2017
vendor/plugins initial commit Feb 9, 2011
.gitignore
.rspec Update test-suite Jan 15, 2017
Gemfile Update to rails 5.2 May 10, 2018
Gemfile.lock Update to rails 5.2 May 10, 2018
README.markdown Adapted readme. Oct 22, 2011
Rakefile initial commit Feb 9, 2011
config.ru initial commit Feb 9, 2011

README.markdown

cocoon_simple_form_demo

cocoon is a Rails3 gem to allow easier handling of nested forms.

This is a small demo that shows cocoon in action together with slim and simple_form.

Cocoon itself is formbuilder-agnostic, so it works with standard Rails form-builder, Formtastic or simple_form.

Notes

Formtastic is easier to start with, because it has a default css.

In this project I aimed to show that 1) simple_form works, and 2) its customisability, which allows it to be used perfectly together with twitter-bootstrap. While the layout is far from ideal, it is merely intended as a show-case, and the main purpose was to show that it is functioning.

Demonstrated relations

In this project my main intention was to demonstrate how one could solve nested forms, using cocoon for different types of relations. The demonstrated relations in this project are:

  • a project :has_many tasks
  • a task :has_many sub-tasks (double nested relation)
  • a project has an owner (:belongs_to). Where the owner is either selected from a list, or created.
  • a project :has_many tags :through project-tags. Either you select an existing tag, or create and link to a new one. When unlinking from a tag, the tag is not deleted, only the link.

Copyright

Copyright (c) 2011 Nathan Van der Auwera. See LICENSE for details.

You can’t perform that action at this time.