Can somebody please tell me how to put javascript in the controller. I tried someting like this in the sessions controller:
def sign_in if user.nil? @title = "Sign in" render :js => "alert('Invalid email/password combination.');" else sign_in user redirect_back_or user end end
when I tried that, the page displays in text format: alert('Invalid email/password combination.');
I don't want to use the flash message. I really wanted to use javascript alerts... Pls help...