Answer the question
In order to leave comments, you need to log in
What is more civilized to write in Ruby on Rails: @current_user.id or session[:user_id]?
Question about the cultural code.
After authorization, @current_user is given from the application controller.
There is also session[:user_id].
That's when you have to write the id of the current user, then I don’t know which one to choose:
@current_user.id or session[:user_id]
Which one is better?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question