Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
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