Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

has_one relationship? #575

Closed
markmcdonald51 opened this issue Oct 4, 2011 · 11 comments
Closed

has_one relationship? #575

markmcdonald51 opened this issue Oct 4, 2011 · 11 comments

Comments

@markmcdonald51
Copy link

I just started using this today and it is pretty simple. I ran it to what looks like a Formtastic problem with a has_one relationship. In my case it is a polymorphic relationship. Everything works fine and dandy from the console but when I try to create a form in Active Admin it comes up with

rvm/gems/ruby-1.9.2-head/gems/activeadmin-0.3.2/app/views/active_admin/resource/edit.html.arb where line #1 raised:

undefined method `addressable_id' for #Person:0x0000001ac13878

Anyway, really love what you have going here. This is really great. Thanks for all the hard work.

Mark

@markmcdonald51
Copy link
Author

So I made a few tests in my app by adding formtastic to my gem file and using it's generators. I connected it to the models which were having problems before and everything worked just fine and dandy. This must be a problem with Active Admin's bridge to Formtastic.

@cgunnels
Copy link

ever figure this out?

@phil88530
Copy link

still getting the issue, any luck of its solution?

@cgunnels
Copy link

I think the field name has to be addressable_ids

@hoangnghiem
Copy link

Give this a try (Organizer has_one Profile)

form do |f|
  f.object.build_profile
  f.inputs "Organizer Registration Info" do
    f.input :email
    f.input :password
  end
  f.inputs "Profile" do 
    f.semantic_fields_for :profile do |r| 
      r.inputs :full_name
      r.inputs :company
    end 
  end
  f.buttons
end

@jwaldrip
Copy link

I am seeing the same issue. I think it is something with formtastic. I have getting the issue outside of AA.

@jmacdonald
Copy link

Still getting this issue here as well; a fix would be great!

@mdespuits
Copy link

Has this been discovered to be a Formtastic issue? If so, it could be moved there.

@seanlinsley
Copy link
Contributor

I assume this is still an issue?

@nurettin
Copy link

nurettin commented Aug 4, 2013

@hoangnghiem I gave it a try, but Product organizer_id ends up being nil.

@seanlinsley
Copy link
Contributor

I'm not sure what the problem is here. Closing as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants