If I'm writing a private method, does rails think that every method under the word private
is going to be private? or is it supposed to be only private for the first method?
private
def signed_in_user
redirect_to signin_url, notice: "Please sign in." unless signed_in?
end
def correct_user
@user = User.find(params[:id])
redirect_to(root_path) unless current_user?(@user)
end
does that mean signed_in_user
and correct_user
is private? or just signed_in_user
? Does that mean whenever I need to write private methods, it should be at the end of my file now?