1 2 3 4
pages.each do |channel,(name,types)| count = types.count { |type| type.values.include?('type' => 'dash') } logger.debug "Pages for #{channel} channel:" ...
1 2 3 4
numberWithDelimeter(number) {
var delimeter = arguments[1] || ",";
var separator = arguments[2] || ".";
...
1 2 3 4
class Numeric def evenize(operator = '+') raise ArgumentError, "invalid argument (must be `+' or `-')" unless %w(+ -).include?(operator) ...
1 2 3 4
render :update do |page| page.facebox.reveal(action_string) if options[:action] page.facebox.reveal(template_string) if options[:action] ...
Ruby On shallow controller and params
by Adam,
October 22, 2009 02:56
Good call on find. That's w...
1 2 3 4
class ArticoliController < ApplicationController AVAILABLE_SCOPES = [ BollaDaFornitore, BollaDaRedazione, BollaVersoRedazione, BollaVersoFornitore ] ...
1 2
default_proc = lambda { |hash,key| hash[key] = Hash.new(&default_proc) } hash = Hash.new(&default_proc)
1 2 3 4
class Company < ActiveRecord::Base named_scope :created_after, lambda { |date| { :conditions => [ 'created_at > ?', date ] } if date } named_scope :in_locality, lambda { |location| { :conditions => [ 'locality_id IN (?)', location.is_a?(Array) ? location : Locality.find_with_children(location) ] } } ...
1 2 3 4
def move_old_collection_to_new_collection source = CollectionOne.find(params[:collectionone_id]) destination = CollectionTwo.find(params[:collectiontwo_id]) ...
Ruby On Moving collections with eva...
by Adam,
September 24, 2009 21:19
I think you may want to ret...
1 2 3 4
class Category < ActiveRecord::Base self.find_with_children_by_slug(slug) category = find_by_slug(slug, :include => :direct_children) ...
1 2 3 4
function checkInterval(event) { var pad = function(s) { return Array(3 - s.length).join('0') + s } ...
1 2 3 4
def button(title, options = {}) category = options.delete(:category) || 'primary' endcap = content_tag(:div, ' ', :class => 'endcap') ...
1
@documents.map(&:to_hash)
Ruby On Call a function to each member
by Adam,
September 08, 2009 16:26
There is, in fact, somethin...



