Adding the User's Name, Vs adding first and last name.

I attempted to add a column for first and last name instead of just the user's name, after adding the user's name (the combine field as in the etsey demo). I went to remove the users name and i dont think my created migration worked properly. Can someone point me in the right direction to get these removed? I have already read the migration section in the rails manual and i think i might be missing something. Any other links available?

Posted almost 6 years ago by Dustin Weathers
Posted almost 6 years ago by Szabolcs Toth

I wouldn't have removed it, just kept the name field for last name and add one more field for first name. e.g. rails g migration AddToUsers fname:string + rake db:migrate

Posted almost 6 years ago by Alex Yang

I agree with Szabolcs - that's the simplest solution. Don't forget to add fname to the list of 'whitelisted' parameters in your controller, add fname to your user signup form, and display it wherever else you've been displaying the user's name.

Posted almost 6 years ago by Jackson Quach

Dustin, interesting. I ran into something in the related realm. The process of stripe requires 2 both first and last name. I can into errors as a user who inputted JacksonQuach. I think we have to create two boxes to solve for the issue.