I'm new to Ruby on Rails as well as Web development and was following the rails tutorial on youtube by Michael Hartl when I encountered a very confusing code. the code is:
def create
@user = User.new(params[:user])
end
I just can't understand where the ":user" key comes from or what it's value is. I've been trying to read all about symbols and hashes in ruby but it just confused me more. At first there was this code in the tutorial:
def show
@user = User.find(params[:id])
@title = @user.name
end
in which I understand that the "params[:id]" is a hash with key value :id, where :id => (id in the database) but with the params[:user], I just got lost. I don't have any column for "user", but my model is named "user".
So with that, my simple question would be... where did the key ":user" comes from and what is it's value?