This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
CHANGELOG | Fri Apr 11 09:42:31 -0700 2008 | |
| |
README | Fri Apr 11 09:42:31 -0700 2008 | |
| |
Rakefile | Fri Apr 11 09:36:35 -0700 2008 | |
| |
init.rb | Fri Apr 11 09:36:35 -0700 2008 | |
| |
install.rb | Fri Apr 11 09:36:35 -0700 2008 | |
| |
lib/ | Wed Jun 04 08:41:39 -0700 2008 | |
| |
sample_project/ | Fri Apr 11 09:33:57 -0700 2008 | |
| |
tasks/ | Fri Apr 11 09:36:35 -0700 2008 | |
| |
test/ | Fri Apr 11 09:36:35 -0700 2008 | |
| |
uninstall.rb | Fri Apr 11 09:36:35 -0700 2008 |
README
= Multimodel-Forms This plugin allows multiple models to have a place in one form. For example, if an article model has_many links. The links can be edited, created, deleted and even sorted (acts_as_list) from the article edit/new form. Included ajax helpers so links can be added and deleted client side and db is only touched when form is submitted. This is largely derived from Ryan Bates' tutorial over at: http://railscasts.com/episodes/75 Acquire via git at: git clone git@github.com:sudothinker/multimodel-forms.git Sample project available in multimodel-forms/sample_project - This can be removed if not needed. == Example article.rb class Article < ActiveRecord::Base has_many_with_attributes :links end -- link.rb class Link < ActiveRecord::Base belongs_to :article end Can now add a view partial to render the article form and edit the associated links. articles/_form.rhtml <label>Title</label> <%= f.text_field :title %> <h3>Links</h3> <div id="links"> <%= render :partial => 'links/link', :collection => @article.links %> </div> <%= add_link "Add link", :link %> links/_link.rhtml <p class="link"> <% fields_for_associated :article, link do |l_form| %> <%= l_form.text_field :url, :index => nil %> <%= delete_link_for(link, "Delete", l_form) %> <% end %> </p> Written by Michael Murray <mdmurray@gmail.com>








