Skip to content

Instantly share code, notes, and snippets.

@tubbo
Created August 5, 2010 23:46
Show Gist options
  • Select an option

  • Save tubbo/510595 to your computer and use it in GitHub Desktop.

Select an option

Save tubbo/510595 to your computer and use it in GitHub Desktop.
<div id="login-window" title="Sign in with your username and password">
<p>
<%- form_tag session_path do -%>
Login: <%= text_field_tag 'login' %><br />
Password: <%= password_field_tag 'password' %>
<%- end -%>
</p>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#login-window').dialog({
autoOpen: false,
//minHeight: 480,
width: 320,
resizable: false,
draggable: false,
modal: true,
buttons: {
"Log In": function() {
$.post('/sessions', $('#login-form').serialize(), function() {
$(this).dialog('close');
location.reload(); // refresh page
});
},
"Cancel": function() {
$(this).dialog('close');
},
"Register": function() {
window.location = '/signup';
$(this).dialog('close');
}
},
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment