I am trying to lowercase params[:user][:email] in my application but currently I’m using @user = User.new(params[:user]) (which includes the email) in my def create. Is it possible to allow for mass assignment for everything except for a single item?
I know I could just not use mass assignment but I was wondering if this was possible.
Yes.
Here’s how you’d use it:
If you want to downcase the email attribute automatically though, you can simply override the
email=method, which I strongly recommend: