Skip to content

Instantly share code, notes, and snippets.

@jonpaul
jonpaul / gist:1232322
Created September 21, 2011 15:14
Full trace
activesupport (3.0.9) lib/active_support/whiny_nil.rb:48:in `method_missing'
mongoid (2.2.0) lib/mongoid/fields.rb:51:in `defaults'
mongoid (2.2.0) lib/mongoid/attributes.rb:145:in `block in apply_default_attributes'
mongoid (2.2.0) lib/mongoid/attributes.rb:144:in `tap'
mongoid (2.2.0) lib/mongoid/attributes.rb:144:in `apply_default_attributes'
mongoid (2.2.0) lib/mongoid/document.rb:129:in `block in initialize'
mongoid (2.2.0) lib/mongoid/relations/builders.rb:47:in `building'
mongoid (2.2.0) lib/mongoid/document.rb:127:in `initialize'
app/controllers/listings_controller.rb:13:in `new'
app/controllers/listings_controller.rb:13:in `new'
@jonpaul
jonpaul / error
Created September 21, 2011 14:46
NoMethodError in ListingsController#new
undefined method `defaults' for nil:NilClass
Rails.root: /Users/derek/mdm
Application Trace | Framework Trace | Full Trace
app/controllers/listings_controller.rb:13:in `new'
app/controllers/listings_controller.rb:13:in `new'
╰─$ rspec spec/mailers 1 ↵
.F
Failures:
1) UserMailer Invite Emails should contain a link to the signup portal
Failure/Error: @email.should have_body_text(/#{signup_organization_url}/)
ActionController::RoutingError:
No route matches {:action=>"signup", :controller=>"organizations"}
# ./spec/mailers/user_mailer_spec.rb:21:in `block (3 levels) in <top (required)>'
@jonpaul
jonpaul / database_value
Created September 14, 2011 20:01
Why does TinyMCE ruin everything?
<p>Welcome to the Career Page of Sarasota Orthopedic Associates. Sarasota Orthopedic Associates is always looking for talented, professional, skilled and motivated individuals to join our staff. Below are the current opportunities with SOA. We look forward to hearing from all qualified candidates.</p>
<p><strong>Patient Advocate</strong></p>
<p><strong>Status:</strong> Full Time</p>
<p><a title="Download Employment Application" href="../whitepaper/employment_application.doc" target="_blank">Download Application</a></p>
<p><strong>SCOPE OF POSITION</strong></p>
<p><strong></strong>The Patient Advocate is responsible for the collection of delinquent patient balances (including self-payments, co-pays, deductibles and co-insurance), transmitting patient statements and responding to patient inquiries regarding balances due.</p>
<p><strong>OPERATIONAL RESPONSIBILITIES</strong></p>
<ol>
<li>Transmits and prints statements on a daily/weekly basis according to established protocol.</li>
<li>Answers all patient telepho
if ($(".contentRow .contents .calendar:not(.fc)").length > 0) {
$('.contentRow .calendar').fullCalendar({
// see http://arshaw.com/fullcalendar/docs
// for details.
events: '/events.json',
eventRender: function(event, element) {
console.log(event)
element.html("<a class=\"descReadMore\" href=\"events/\" + event.id></a>");
},
viewDisplay: clearDayHighlights,
@jonpaul
jonpaul / custom.js
Created August 31, 2011 18:14
PLUpload issue
<script type="text/javascript">
// Convert divs to queue widgets when the DOM is ready
<% if !current_user.blank? %>
<% if current_user.is_dealer? || current_user.admin? %>
var image_limit = "10";
<% else %>
var image_limit = "<%= @product.product_vehicle_listing_detail.photos %>";
<% end %>
<% else %>
var image_limit = "<%= @product.product_vehicle_listing_detail.photos %>";
@jonpaul
jonpaul / task.rb
Created August 26, 2011 19:18
rake task example
namespace :import do
desc "Find CSV files in a specified directory and import their rows as vehicle listings"
task :listings => :environment do
Admin.new(..)
end
end
@jonpaul
jonpaul / development.rb
Created August 26, 2011 16:57
Fix up your /environments/*.rb to use PRY
MyApp::Application.configure do
silence_warnings do
begin
require 'pry'
IRB = Pry
rescue LoadError
end
end
end
@jonpaul
jonpaul / _task.html.haml
Created August 19, 2011 19:35
Snippets for ajaxy clickyness
%li{:id => "task_#{task.id}", :class => "task"}
%span.handle= image_tag('arrow_ns.png')
= task.description
= link_to image_tag('cross.png'), project_task_path(task.project, task), :confirm => 'Destroy Task ?', :method => :delete, :remote => true
= link_to image_tag('accept.png'), complete_task_path(task.project, task), :method => :post, :remote => true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_controller.perform_caching = false