Map and to_proc to easier capitalize array of strings
["auckland", "christchurch", "wellington", "hamilton", "tauranga", "dunedin", "palmerston north", "hastings", "nelson", "napier", "rotorua", "new plymouth", "whangarei", "invercargill", "wanganui", "gisborne"].map(&:capitalize)
In: Uncategorized · Tagged with: blocks, Proc, Rails, Ruby, to_proc
Ruby on Rails – Easier enumerations (Select, Collect, Map) using Ampersand
a = [] # setup array 0.upto(100) do #just make up some array a << rand(1000) end s = a.in_groups_of(6,false) # make it an array of arrays (so we can use the sort method on each element of the outer array) s.collect(&:sort) #sort each array inside the outer array in one easy step What are […]
In: Uncategorized · Tagged with: arrays, collections, enumerations, Rails, Ruby
Facebook Connect – send feed dialog to profile
A quick Facebook Connect tutorial showing how to add user login and sending a feed dialog to the FB profile.
In: Uncategorized · Tagged with: Facebook, facebook connect, facebook feed dialog, facebook profile feed, Rails
Objective Resource to the rescue
So I’m working on a top secret military iPhone app to be deployed in a top secret location… Anyway, it needs to interact with a rails app. Googled around, found objective resource which is a great objc port of Active Resource. Now, I needed to man handle it a bit for what I want it […]
In: Iphone · Tagged with: Active Resouce, iPhone, Objective C, Objective Resource, Rails