vendredi 10 juillet 2015

Doctor(#70193604975300) expected, got ActionController::Parameters(#70193536484960)?

I am creating form which accepts nested attributes: #doctor.rb

#user.rb
  has_one :doctor
  accepts_nested_attributes_for :doctor, reject_if: proc { |attributes| attributes['cartridge_name'].blank? }, allow_destroy: true

my strong parameters:

def user_params
      params.require(:user).permit(:name,:birthday, :address, :phone,:email, :role, :social => [],
                    :doctor => [:position,:department_id,:salary_type,:date_came,:monthly_salary,:percentage_salary,:id],
end

But i got error:

Doctor(#70193541488440) expected, got ActionController::Parameters(#70193536484960)

Probably it is the problem with associations or with my strong params.

Aucun commentaire:

Enregistrer un commentaire