O'Reilly Answers is a community site for sharing knowledge, asking questions, and providing answers that brings together our customers, authors, editors, conference speakers, and Foo (Friends of O'Reilly). More »
I recently wanted to migrate some Ruby on Rails applications from version 2 to 3. I also had for some time wanted to migrate from Ruby 1.8 to Ruby 1.9. Many people recommended using RVM to manage a mu...
Answered by cjapes : Jan 18 2011 05:50 AM
Because it is a multidimensional array.
if you want just the first record try doing this: detail.first.programCode
or if you need to go through all programCode your query gives you you can do:
det... full answer >
Ruby on Rails took the software industry by storm a few years ago. However, unlike many technologies that looked great for a while and then slacked in popularity, Rails continues to attract developer...
Asked by DaveEveritt : 20 February 2010 - 02:41 AM
Answered by adfm : Mar 10 2010 12:05 PM
Deployment and maintenance can be a major time suck. It seems like you already have a good idea of what's out there, but are looking for a path to the next level. I would suggest finding a decent ... full answer >
Answered by kyle.burton : Nov 10 2009 10:00 AM
If the goal is just to externalize the configuration, there are several implementation strategies (yaml, arguments to a function, additional parameters if it's a rails controller etc).
This is an... full answer >
There is a variety of software (including the Unix command-line
utility uniq and Windows PowerShell
cmdlet Get-Unique) that can help you remove duplicate lines in a file or
...
If you're writing a web application, and you want to find places (restaurants, theaters) within a certain distance from your user, you'll probably need to work with zip codes. Here's a go...
Use the Warbler gem. From the JRuby Cookbook:
Use Warbler to package your Rails application as a WAR file. Start by installing the gem:
$ jruby –S gem install warbler
This gem adds the warb...
If you want to check whether a certain string represents a valid IPv4 address in 255.255.255.255 notation, try one of these examples from Regular Expressions Cookbook:
Simple regex to check fo...
Asked by mike-loukides : 29 September 2009 - 02:03 PM
Answered by codemonky : Nov 04 2009 11:33 AM
Ruby does not allow you to control the size of the objects you create. There are currently no gems that abstract out the particular problem you've described. Sad to say, but shifts as masks on int... full answer >