0

I would like to use form_for except I have class table inheritance models using the citier gem. They are defined as such:

class Fruit < ActiveRecord::Base
    # calories:integer
    # color:string
end 

class Apple < Fruit
    # is_sauce:boolean
end

class Banana < Fruit
    # is_peeled:boolean
end

The problem is that I want the first part of my form to fill out attributes for my Fruit model. Then depending on a select field on what type of fruit (Apple, Banana), I then want to fill out attributes for that particular model yet I still want validations with the form_for helper. Any suggestions on how I can approach this... or additional clarification? Thanks.

axsuul
  • 7,370
  • 9
  • 54
  • 71

1 Answers1

1

What I ended up doing was asking for the model before creating the form. Then using many partials.

axsuul
  • 7,370
  • 9
  • 54
  • 71