you are not signed in | sign in or register
Ruby Fleebie
Rediscovering the joy of programming
Feed & Web Facts
10
Feed Item Count
22 May 12 01:43
Last Reading
1.0
RSS/XML Version
UTF-8
Feed Encoding
Page-Views
 
Weekly People
Week
rubyfleebie.com
Ruby Fleebie
Newest Posts in Feed
Nested has_many :through
Hi (Oh my God… he just started his blog post with ‘Hi’), Did you know that as of Rails 3.1, you can have nested has_many :through clauses in your models? Here is a concrete example to understand what I mean:
How To Strip Insignificant Zeros From a Float In Rails
I had a float attribute in a Rails application and wanted to strip non-significant zeros when displaying it on a page. With the number_with_precision helper from ActionView, that’s a trivial thing:
How to hook to an Array instance in a Ruby module
On some project we needed to create a module containing an Array attribute. We wanted to hook onto some of the methods of this particular Array instance to call our own code. Here is how we did it: And now the output: