Instance variables defined in controller would be available in views, including partial. There is no doubt. But the problem is not here.
The problem is about params
. params
values are all in String. So, the evaluation if params[:show_log_in] == true
is wrong and always returns false, and the instance defined there will never be sent.
You need to compare it as a string.
if params[:show_log_in] == "true"
Moreover, it is not good you render a HTML partial in a JS response. I'm not sure if this will work but the legit way is to render js.erb
file.