Here is some of the code I have -- I am trying to create a new order
using AS.
class OrderController < ApplicationController
active_scaffold do |config|
config.columns = [ :sku, :order_qty, :purchaser ]
end
end
class Order < ActiveRecord::Base
belongs_to :sku
belongs_to :purchaser, :class_name => 'User'
end
class Sku < ActiveRecord::Base
belongs_to :group
has_many :assets
has_many :orders
end
class Asset < ActiveRecord::Base
belongs_to :sku
end
class User < ActiveRecord::Base
has_many :assets
end
However, when I click to create a new order, I get the error...
ActionView::TemplateError (Mysql::Error: Unknown column 'user_id' in
'where clause': SELECT * FROM `assets` WHERE ((user_id IS NULL)) ) on
line #7 of vendor/plugins/active_scaffold/frontends/default/views/
_form_attribute.html.erb:
The question is: What is causing AS to think assets has a user_id? I
am very confused. I can see the following chain could be happening...
To draw the order form, it needs to know the SKU and the user. But why
does the form also need to know the assets associated with the user?
How do I short-circuit it?
Martin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---