Welcome to the Treehouse Community
Looking to learn something new?
First name and last name have no value, possibly due to strong parameters
I have just found out that first_name and last_name have no value and I am using version 4.1 of ruby. Here is my code for user.rb:
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
def full_name first_name + " " + last_name end
def create user.create(user_params) end
private def user_params params.require(:user).permit(:email, :password, :password_confirmation, :remember_me, :first_name, :last_name, :profile_name) end end
I have a feeling that it is something to do with strong parameters but I am not sure if I am using it correctly
Chris Dziewa17,781 Points
In your create method you need to change
User. I think your strong parameters are fine. Let me know if that fixes it.
Yeah I will probably downgrade my version because implementing a new user controller would be one big headache. But thanks anyway for your help, I appreciate it! Hopefully treehouse will update their tutorials soon for rails