Skip to content

Instantly share code, notes, and snippets.

@ruckus-matte
ruckus-matte / bundle exec rake output.md
Created November 17, 2011 22:59
autotest error with Logging gem
➔  bundle exec rake
root  ............................................  *debug      -T
- <Appenders::RollingFile:0x8134831c name="file">
  ActionController::Base  ........................   debug  +A  -T
  ActiveRecord::Base  ............................   debug  +A  -T
  ActiveSupport::Cache::FileStore  ...............   debug  +A  -T
  ActiveSupport::Dependencies  ...................   debug  +A  -T
  Logging  .......................................    *off  -A  -T
  Rails  .........................................   debug  +A  -T
@ruckus-matte
ruckus-matte / view_helpers.rb
Created March 14, 2011 20:49
new view_helpers.rb for Cocoon gem. fixes problem where :class_name is different from has_many association name
module Cocoon
module ViewHelpers
# this will show a link to remove the current association. This should be placed inside the partial.
# either you give
# - *name* : the text of the link
# - *f* : the form this link should be placed in
# - *html_options*: html options to be passed to link_to (see <tt>link_to</tt>)
#
/*
* stickyfloat - jQuery plugin for verticaly floating anything in a constrained area
*
* Example: jQuery('#menu').stickyfloat({duration: 400});
* parameters:
* duration - the duration of the animation
* startOffset - the amount of scroll offset after it the animations kicks in
* offsetY - the offset from the top when the object is animated
* lockBottom - 'true' by default, set to false if you don't want your floating box to stop at parent's bottom
* $Version: 05.16.2009 r1
if Gem.available?('paperclip')
gem 'paperclip'
gemrootdir = File.join(Gem.datadir('paperclip'), '../..')
pre232taskfile = File.join(gemrootdir, 'tasks/paperclip_tasks.rake')
post232taskfile = File.join(gemrootdir, 'lib/tasks/paperclip.rake')
# if post2.3.2 directory exists
if File.exists?(File.expand_path(post232taskfile))
import post232taskfile
else