Hi
I have the following models :
class Company < ActiveRecord::Base
has_many :contacts, :as => :contactable
end
class User < ActiveRecord::Base
has_many :contacts, :as => :contactable
end
class Contact < ActiveRecord::Base
belongs_to :contactable, :polymorphic => true
end
and the following controllers :
class CompaniesController < ApplicationController
active_scaffold :company do |c|
....
c.create.columns = [ :name, : address, :contacts ]
c.update.columns = [ :name, : address, :contacts ]
....
end
end
class UsersController < ApplicationController
active_scaffold :company do |c|
....
c.create.columns = [ :name, : address, ..., :contacts ]
c.update.columns = [ :name, : address, ...., :contacts ]
....
end
end
class ContactsController < ApplicationController
active_scaffold :contact do |c|
...
# category is : :phone, :web, :email, :skype, :mobile, :fax
c.subform.columns = [ :category, :content ]
end
end
If I use the create (or update) form to add (or modify) a company (or
an user), I have a subform to add some contacts. I have a button
called "Create another" to add a row to fill a new contact..
But the button "Create another" executes like a submit of the form :
I filled the form of the company, I filled the form of the first
contact, I clicked on "Create another" and it validates the all form,
returns to the "Companies List", creating the first contact..
I missed something ??
VIncent
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---