I got a error. I don't understand that exception. What happened ?
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
i written this code:
if @personal_information.save
HamtranZeeldegchs.new(params[:hamtran_zeeldegch]['0']) # This line
is may a error.
hzs = HamtranZeeldegchs.new(params[:hamtran_zeeldegch]['0'])
hzs.personal_information_id = @personal_information.id
hzs.save
MODEL:
class PersonalInformation < ActiveRecord::Base
has_many :hamtran_zeeldegchs,:foreign_key => 'personal_information_id' ,
:class_name => 'HamtranZeeldegchs', :dependent => :destroy
class HamtranZeeldegchs < ActiveRecord::Base
belongs_to :personal_information , :class_name => 'PersonalInformation',
:foreign_key => ':personal_information_id'
Can anyone help me ?
-------------
Thanks
Tsolmon
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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/rubyonrails-talk?hl=en.