Ask A Question

Notifications

You’re not receiving notifications from this thread.

Rails 4.0 and Devise With Strong Params and Custom Fields Discussion

Chris Oliver asked in General

Short and simple. Thanks a lot. I've been looking for a solution all morning.

Reply

This works for me except i use simple_form_for
Thanks.

Reply
Rodrigo Sanguanini Rodrigo Sanguanini

You can use instead of

devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :password, :password_confirmation, :full_name, :phone) }

This

devise_parameter_sanitizer.for(:sign_up) << :full_name, :phone

Reply

Thanks Rodrigo! Definitely a cleaner implementation because this way you're only adding fields.

Reply

How do permit strong parameters if I have multiple devise models?

Reply

That's a good question. I've never actually checked into that. You should ask on the Github Issues for Devise. They'll definitely know the answer to that.

Reply

How to Keep form fields filled after an error in signup?

Reply
Join the discussion
Create an account Log in

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

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

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