Skip to content

Instantly share code, notes, and snippets.

@Anuragjain89
Anuragjain89 / gist:d48aa393b49eec474c84
Last active August 29, 2015 14:23
Ajax file upload with remote:true

Update on file upload using ajax.

While uploading the file with remote true,.. the system would require us to specify authenticity token. Otherwise, you will get error stating invalid authenticity token.

<%= nested_form_for [@project, @test_run, @test_runs_test_case], remote:true, authenticity_token: true do |f| %>

Internally the request is sent as HTML instead of xhr when the params contains any new attachment.

      if (remote) {
@Anuragjain89
Anuragjain89 / master-slave-notes.rb
Last active February 6, 2023 12:22
Notes on postgres master slave configuration.
REFERENCES
# https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-on-postgresql-on-an-ubuntu-12-04-vps
# https://sonnguyen.ws/replication-master-slave-with-postgresql-9-4-in-ubuntu-14-04/
# http://senvichet.com/how-to-setup-postgres-9-4-master-slave-streaming-replication/
============================================================================================================
INITIAL STEPS FOR BOTH MASTER AND SLAVE
============================================================================================================
# -----------------------------------------------------------------------------------------------------------
TODO ( STEPS SIMILAR TO SETTING UP AN EC2 INSTANCE ): Install essential software dependencies after system upgrade
# -----------------------------------------------------------------------------------------------------------