I'm having trouble constraining an embedded scaffold of a HABTM
association. I'm sure it's just me, and that by posting this question
I'll be showing just how little I understand the simplicity of
ActiveScaffold. But here goes anyway.
class Contact < ActiveRecord::Base
has_and_belongs_to_many :orders
end
class Order < ActiveRecord::Base
has_and_belongs_to_many :contacts
end
(I do have a join table called contacts_orders in my database, but no
model in my rails application.)
_update_form_.rhtml (override inside the order view)
<%= render :active_scaffold => 'contacts', :constraints => {:order_id
=> @record.id} %>
This does not work because order_id does not exist inside Contact
model
What am I missing to constrain this embedded scaffold so that it only
deals with the contacts that are related to this order?
I'll be thankful for any help that you can give.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---