ruby on rails - RailsAdmin doesn't correctly handles belongs_to -
i playing railsadmin on rails 4. , have simple case (two models, event belongs idea).
code:
class idea < activerecord::base end class event < activerecord::base belongs_to :idea end
schema
create_table "events", force: true |t| t.string "location" t.integer "idea_id" t.datetime "created_at" t.datetime "updated_at" end add_index "events", ["idea_id"], name: "index_events_on_idea_id" create_table "ideas", force: true |t| t.string "title" t.text "descrption" t.datetime "created_at" t.datetime "updated_at" end
and seeing this. , can't figure out why show both drop down choose idea , additional numeric editbox?
.
railsadmin
heavily relies on relationships dynamically generate forms. aside that, have encountered other issues down line if didn't map relationships both models.
class idea < activerecord::base # missing has_many :events end class event < activerecord::base belongs_to :idea end
Comments
Post a Comment