开发者

storing username in ruby using session and database serious problem

开发者 https://www.devze.com 2023-03-28 08:08 出处:网络
I have been tearing my hair out for the last 24 hours, all I am really trying to do is simple. A user has an edit page where they can edit thier details, but before I can do this I need to retrieve th

I have been tearing my hair out for the last 24 hours, all I am really trying to do is simple. A user has an edit page where they can edit thier details, but before I can do this I need to retrieve the student unique identifier (k_number) is my database primary key in the student database.

def edit
    @title = "Edit Your Details"

    @user_id = session["user_id"]  
    @current_user = Student.find_by_k_number(session["user_id"])
end

Its just not working, when I开发者_高级运维 look at the backend query, the k_number is being passed as null. Please help


Perhaps:

 @current_user = Student.find_by_k_number(params[:user_id])
0

精彩评论

暂无评论...
验证码 换一张
取 消