I am a newbie at RoR so thank you for your patients.
I have a form with the following fields:
I want to take them and make them into one variable "name" and submit
that to my table field named "name". Can anyone help?
For this case… a lot of way…
- make name in model --> this is the best way
- make name in controller -> this is good way
way no 1
self.name = @first_name + " " + @last_name
user = User.new()
user.first_name = params[:first_name]
user.last_name = params[:last_name]
way no 2
For example model user, controller costumer
user = User.new
user.name = params[:first_name] + " " + params[:last_name]
I hope it will help you…
This is exactly what I was looking for.
Sean McGilvray & Sarena Byers
Identity Theft Specialist
Pre-Paid Legal Service’s, Inc. NYSE:PPD