I tried to use jQuery in a Rails view with if but it didn't work well. Any advicse?
This is the view:
jquery when the page ready
:javascript
$(document).ready(function{
$('#msg').hide();
})
-if !@x || !@p
:javascript
$(document).ready(function{
$('#msg').show();
})
%h5.alert.alert-error#msg.put Invalid email or password
This is the controller:
@x=Profolio.find_by_email(params[:user])
@p=Profolio.find_by_password(params[:userpassword])