Skip to content

Instantly share code, notes, and snippets.

@lexer
Created April 10, 2011 16:27
Show Gist options
  • Save lexer/912489 to your computer and use it in GitHub Desktop.
Save lexer/912489 to your computer and use it in GitHub Desktop.
Action link sample
form#form1(action='/form', method='post')
input(type="text",name="user[name]")
input(type="text",name="user[email]")
input(type='submit', value='Submit')
script(type='text/javascript')
$(function() {
$('#form1').submit(function(e){
$(this).invoke().success(function(data){
});
e.preventDefault()
});
});
a#link1(href='/actionlink', data-method='post', data-type='json') foo
script(type='text/javascript')
$(function() {
$('#link1').click(function(e){
$(this).invoke().success(function(data){
});
e.preventDefault()
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment