With devise one uses before_filter :authenticate_user!
to restrict access to authenticated users only.
When an unauthenticated
You can use the .live on the "ajax:error" event binding if you are doing ":remote => true".
$('#member_invite, #new_user')
.live("ajax:success", function(evt, data, status, xhr){
$.colorbox.close();
})
.live("ajax:error", function(evt, data, status, xhr){
alert("got an error");
});
where the "#new_user" would be the form ID value.
Note that a more elegant way if you already have an overlay or dialog is simply to insert a message, so instead of alert():
$('.messages').html('Invalid email or password');
and in your signin form you just do a
Or you could even just replace the title of the form, what ever your needs are.