def create
chef = Chef.find_by(email: params[:email])
if chef && chef.authenticate(params[:password])
**session[:chef_id] = chef.id**
flash[:success] = "You logged In"
redirect_to recipes_path
else
flash.now[:danger] = "Check your email or password"
render 'new'
end
end
session[:chef_id] = chef.id
吗?那session[:chef_id]
是一种变数还是什么?厨师的ID是分配给哪个?我可以在那里使用其他名字吗?
谢谢!那解决了 – Vijay