the strangest thing is happening…i’m not getting this every time,
maybe 1/3 of the time, identical requests…
i’m a rails newbie, but i think i’m trying pretty standard stuff, this
is an excerpt from the log:
Processing EmailConfigsController#edit_xml (for 127.0.0.1 at 2007-10-24
15:52:09) [GET]
Session ID: 6630219819a2da423d8c48a259dd28d6
Parameters: {“action”=>“edit_xml”, “id”=>“1”,
“controller”=>“email_configs”}
â†[4;36;1mEmailConfig Load (0.000000)â†[0m â†[0;1mSELECT * FROM
email_configs WHERE (email_configs.id = ‘1’) â†[0m
NoMethodError (undefined method email_config_id=' for #<EmailRecipient:0x463caa0 @new_record=true, @attributes={}>): c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/base.rb:1860:in
method_missing’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/base.rb:1675:in
send' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/base.rb:1675:in
attributes=’
in my controller:
def edit_xml()
@email_config = EmailConfig.find(params[:id])
@email_recipient = EmailRecipient.new(:email_config_id =>
@email_config.id)
render :xml => @email_config.to_xml(:dasherize => false, :include => [
:email_recipients ])
end
my models:
class EmailConfig < ActiveRecord::Base
has_many :email_recipients
validates_presence_of :name, :from, :subject, :template
end
class EmailRecipient < ActiveRecord::Base
belongs_to :email_config
validates_presence_of :send_as, :email
end
my tables:
db2 => describe table whitecap.email_configs
Column Type Type
name schema name Length
Scale Nulls
ID SYSIBM INTEGER 4
0 No
NAME SYSIBM VARCHAR 128
0 No
FROM SYSIBM VARCHAR 64
0 No
SUBJECT SYSIBM VARCHAR 128
0 No
TEMPLATE SYSIBM VARCHAR 128
0 No
5 record(s) selected.
db2 => describe table whitecap.email_recipients
Column Type Type
name schema name Length
Scale Nulls
ID SYSIBM INTEGER 4
0 No
EMAIL_CONFIG_ID SYSIBM INTEGER 4
0 No
SEND_AS SYSIBM VARCHAR 3
0 No
EMAIL SYSIBM VARCHAR 128
0 No
4 record(s) selected.
if anyone has any ideas, thanks! i’m going nuts trying to figure this
out.
Richard