Problem with relations #1

Closed
lucassus opened this Issue Mar 18, 2012 · 3 comments

3 participants

@lucassus

The is a small problem with relations. For example I have the following Product and Group models:

class Product
  include Mongoid::Document
  include Mongoid::Timestamps

  field :name, :type => String
  field :description, :type => String
  field :price, :type => Float

  belongs_to :group
end

class Group
  include Mongoid::Document
  include Mongoid::Timestamps

  field :name, :type => String

  has_many :products
end

When I open product's form for group I see regular text field in which I have to provide a valid group id.
When I override a product's form:

ActiveAdmin.register Product do

  form do |f|
    f.inputs do
      f.input :name
      f.input :description, :as => :text
      f.input :price
      f.input :group
    end

    f.buttons
  end

end

then I can use select box for selecting a group.

@elia elia was assigned Mar 20, 2012
@elia
Owner

@lucassus are you able to track down the difference between the vanilla activeadmin and the custom version?

@proxygear

Same problem for me. I gonna investigate it soon.

@elia
Owner

Closing for low traffic, feel free to ping me for reopening.

@elia elia closed this Oct 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment