vendredi 26 mai 2017

How to copy a attribute of another model in rails?

i'm trying yo get the email from user after create but in the logs show a error

the method that i'm trying is:

someone can spare a hint?

class Car < ActiveRecord::Base

belongs_to :user

after_create :get_email

def get_email
   email = user.email.dup

  end
end

Aucun commentaire:

Enregistrer un commentaire