Skip to content

Instantly share code, notes, and snippets.

@alaingoldman
Created August 8, 2013 03:17
Show Gist options
  • Save alaingoldman/6181155 to your computer and use it in GitHub Desktop.
Save alaingoldman/6181155 to your computer and use it in GitHub Desktop.
window.location.href = <%= root_url %>
$.ajax({ url: '#{addbank_bankaccts_path}',
type: 'POST',
beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', '#{form_authenticity_token}')},
dataType: "json",
data: 'account_uri=' + response.data.uri ,
success: function(response) {
}
});
class BankacctsController < ApplicationController
def new
end
def addbank
# add bank account logic here
# redirect_to root_url
# ^ that doesn't work
# respond_to do |format|
# format.js
# end
# ^ couldn't get that to work either
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment