i am new to Rails .. i am having a Table named users (id,name) and another table which has the additional information of the user called user_details(id,user_id,additional_info) where additional_info is a hash .
In the User Model i added a line
has_one :user_details And in the User_Detail model i added a line
belongs_to :user serialize :additional_details, Hash Now in the Users Controller i am having an action
# set_user_empid to set the hash value empid in the additional_info column for the current_user def set_user_empid @user1 = current_user @[email protected]_details @user_detail1.additional_details[:empid] = params[:value] @user_detail1.save render :text => CGI::escapeHTML(@user_detail1.additional_details[:empid].to_s) end The above one @user1.user_details shows me the error as
NameError (uninitialized constant User::UserDetails):
But the same thing if i change the has_one to has_many i am getting the actual result...
Please give suggestions...