- Online Exam Test Papers | - MCQs[multiple choice questions and answers ] | - Mock Test Papers | - Practice Papers | - Sample Test Papers |

Question:
There is a bug in this code. The logout message is not appearing on the login template. What is the cause?
class AccessController < ActionController::Base
def destroy
session[:admin_id] = nil
flash[:notice] = “”You have been logged out””
render(‘login’)
end

1. The string assigned to flash[:notice] will not be available until the next browser request.

2.An instance variable should be used for flash[:notice]

3. This is an invalid syntax to use to assign valuse to flash[:notice]

4. The previous value of flash[:notice] will not be cleared automatically

Posted Date:-2022-09-17 04:19:54


More MCQS Questions and answers

Search