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’])
it sounds like u r going a add a HamtranZeeldegchs row.
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
Have a look at the Rails Guide on debugging. There you will find
methods for debugging your code. In particular you could use
ruby-debug to break into your code before that line and check that the
data are ok.