1 2 3 4
def translation_links lang = [ %w[en english us], ...
Ruby nested array to set of html...
i have a simple array that ...
1 2 3 4
FIELDS = [ 'first', 'last', 'band' ] DATA = [['Kurt', 'Cobain', 'Nirvana'], ['Jimi', 'Page', 'Led Zeppelin'], ...
Ruby Map fields array and data a...
First posting here. I just ...
1 2 3 4
pools = {1 => [1,2,3], 2=> [3,4,5], 3=> [5,6,7]} intersection = [] pools.each do |k,v| ...
Ruby Find the Intersection of Ar...
Find the intersection of ar...
1 2 3 4
times.each do |time| events.each do |event| if time.strftime("%I:%M %p") == event.datetime.strftime("%I:%M %p") ...
Ruby two for loops cleanup?
times is an array of dateti...
1 2 3 4
module Keys_to_Meths def method_missing(meth, *args) if meth.to_s[-1] == 61 #if last char is an equal sign ...
Ruby Hash.keys_to_attr
/no comment/
>_>
1 2 3 4
require 'net/http' require 'rubygems' require 'xmlsimple' ...
Ruby Parsing XML from a Web Service
I'm working with a web serv...
1 2 3 4
require 'erb' # GOAL: render the template with the following vars ...
Ruby Given a hash of variables, ...
by mislav,
April 12, 2008 15:12,
3 refactorings, tagged with erb, singleton, metaclass, metaprogramming, hash, render
This works. Now, is there a...
1 2 3 4
class Hash def fetch_all(key) results = [] ...
Ruby Recursive Hash#fetch
I wanted a Hash#fetch that ...
1 2 3 4
<table class="charge"> <tr> <td colspan="100%" class="mainHeader"><%=@label.label%></td> ...
Ruby Iterating through a nested ...
by mwilliams,
January 31, 2008 18:21,
2 refactorings, tagged with rails, view, table, hash, nested hash, iterator, iterate, ruby, Ruby on Rails
Good afternoon. I have a n...
Conversion from the 2d arra...