Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I use phonelib gem for a nested resource?

Seth asked in Rails

I am setting up telephone validation for a Lead model. Leads have a field called :phone. I'm using phonelib to validate the contents of that field. My New Lead form is nested within a second model, therefore the second model accepts_nested_attributes_for :leads. Without phonelib, my leads are saved just fine. With phonelib, I'm getting the following error in my :create action:
wrong number of arguments (given 3, expected 1..2)
Strong params are all set, and the model validations are set. Not sure what's hanging this up. Any ideas?

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.