Ask A Question


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.


This works for me except i use simple_form_for

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) }


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


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


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


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.


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

Join the discussion
Create an account Log in

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

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

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

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.