Hi

I'm having a issue with one object when try to update the attributes in
this object previously saved in the database

I have one object comp and one object reg they have this relationship

comp

has_many regs

reg

belongs_to comp

when run use the method valid? like this

  current_contribuyente.comps.build(params[:comp]).valid?

it returns: IndexError (string not matched)

And when I try to update directly the comp directly it return this
error:
@comp = current_contribuyente.comps.find(params[:id])

@comp.update_attributes(params[:comp])

NoMethodError (undefined method `with_indifferent_access' for
"":String):


This is the code from the view where I create this elements

= form_for @comp, :html => {:id => "new_form", :onsubmit => "return
validate_form()"}, :remote => true do |f|

= f.fields_for :comprobante_emis_regs_attributes do |cer|
              = cer.collection_select :reg_fil,
current_contribuyente.contribuyente_regs, :reg_fil, :reg_fil,
{:include_blank => false}, :class => 'reg_fil', :name =>
"comp[comp_emis_regs_attributes][0][reg_fil]"


Somebody has run into this issue i'm really running out of ideas of how
to fix this.

-- 
Posted via http://www.ruby-forum.com/.

-- 
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to