Skip to content

Instantly share code, notes, and snippets.

View all4miller's full-sized avatar

Angus Miller all4miller

View GitHub Profile
@all4miller
all4miller / gist:4491574
Created January 9, 2013 08:29
file attachements
require 'spec_helper'
describe SomeController do
def file_attachment
test_document = "#{Rails.root}/spec/support/file.csv"
Rack::Test::UploadedFile.new(test_document, "text/csv")
end
describe "POST to #import" do
before do
@all4miller
all4miller / gist:3697625
Created September 11, 2012 11:07
Intercept link and change url
$('a.mapping-link').click(function() {
var href = $(this).attr('href');
href += '?report_month=' + $('#report_month').val();
href += '&dealer_code=' + $('#dealer_dealerCode').val();
$(this).attr('href', href);
});