Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. def update
  2. @profile = Profile.find(params[:id])
  3. @profile.form = "signup"
  4. ...
  5. end
  6.  
  7. undefined method `form=' for nil:NilClass
  8.  
  9. attr_accessible form
  10. ...
  11. validates :city_id, :presence => true, :if => :signup?
  12.  
  13.  
  14. def signup?
  15. #@profile.form == "signup"
  16. #@user.form == "signup"
  17. if self.form == "signup"
  18. return true
  19. else
  20. return false
  21. end
  22. end
  23.  
  24. def create
  25. profile = Profile.new
  26. profile.form = "signup"
  27.  
  28. super
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement