Skip to content

Instantly share code, notes, and snippets.

@binaryphile
binaryphile / gist:2949480
Created June 18, 2012 17:15
406 Not Acceptable error when trying to print
Started GET "/admin/orders/R620580058.pdf?template=invoice" for 10.10.10.11 at 2012-06-18 12:53:27 -0400
Processing by Spree::Admin::OrdersController#show as PDF
Parameters: {"template"=>"invoice", "id"=>"R620580058"}
Spree::User Load (4.3ms) SELECT `spree_users`.* FROM `spree_users` WHERE `spree_users`.`id` = 351 LIMIT 1
Spree::Role Load (4.8ms) SELECT `spree_roles`.* FROM `spree_roles` INNER JOIN `spree_roles_users` ON `spree_roles`.`id` = `spree_roles_users`.`rol
e_id` WHERE `spree_roles_users`.`user_id` = 351
Spree::Order Load (3.8ms) SELECT `spree_orders`.* FROM `spree_orders` WHERE `spree_orders`.`number` = 'R620580058' LIMIT 1
Spree::Adjustment Load (4.0ms) SELECT `spree_adjustments`.* FROM `spree_adjustments` WHERE `spree_adjustments`.`adjustable_type` = 'Spree::Order'
AND `spree_adjustments`.`adjustable_id` IN (378) ORDER BY created_at ASC
Spree::Order Load (6.5ms) SELECT `spree_orders`.* FROM `spree_orders` WHERE `spree_orders`.`user_id` = 351 AND `spree_orders`.`completed_at` IS NU
@binaryphile
binaryphile / gist:2949242
Created June 18, 2012 16:27
spree_print_invoice NoMethodError in Spree/admin/orders#show
NoMethodError in Spree/admin/orders#show
Showing /home/tlilley/.rvm/gems/ruby-1.9.3-p194@spree_dibs_1.1/bundler/gems/spree_print_invoice-40debbcc57f7/app/views/spree/admin/orders/_bye.pdf.prawn where line #8 raised:
undefined method `hook' for #<#<Class:0x00000007a18e50>:0x007f7fe5056718>
Extracted source (around line #8):
5:
6: move_down 20
7:
@binaryphile
binaryphile / gist:2661098
Created May 11, 2012 17:17
Deface override to lengthen names on Spree product index page
#Correction:
Deface::Override.new(:virtual_path => 'spree/shared/_products',
:name => 'lengthen_product_name',
:replace => 'code[erb-loud]:contains("link_to truncate(product.name, :length => 50)")',
:text => '<%= link_to product.name, product, :class => "info", :itemprop => "name", :title => product.name %>'
)
@binaryphile
binaryphile / Gemfile_724
Created October 31, 2011 20:18
Gemfile for issue 724
source 'http://rubygems.org'
gem 'rails', '3.0.10'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Use unicorn as the web server