I am trying to validates a new Admin form with nested attributes
but I don't need the profile validation for the User class,
I wrote a validation in the Profile class with a Proc block to test
the profilable_type, but it's not working ....
is there another way to try ?
Thanks Peter .. just a typing error in my post , actually it's well
written in the models : has_one :profile, :as => :profitable ( even
if profitable would make $$)
you can see params[:admin] and params[:admin][:profile]
in the edit action, if I execute a
@admin = Admin.new(params[:admin])
@admin.valid? => false
@admin.errors = #<ActiveModel::Errors:0x007fde974fc928 @base=#<Admin
id: ....@messages={:email=>["doit être rempli(e)"], :password=>["doit
être rempli(e)"]}
I get only the email and password errors even with a validation in the
Profile model
validates :title, :first_name, :last_name , :presence => true