RSS

Tag Archives: ruby on rails

Added something about Metaprogramming in I Love Ruby

I Love Ruby 2012 cover

Hello Folks,

Added something about meta programming in I Love Ruby. The book is available for download in this link http://goo.gl/FW6slH

Today something happened about this book. There is a rails guy in my office, he called me to his place and said I know a Ruby book written by local guys and it LOOKS …..

He opened it and it was my book he was taking about. But by some means in all these years he had missed I had written it. He showed the picture of Kannan Dos and said, look he is our local guy. I told him to scroll a little up by a page and there he saw my picture and was surprised and shocked. I am happy that he is recommending this book to all people who are beginning to learn Ruby. I’m honored.

He was travelling in my car at the end of the day. He complained about the cover and how this book will blast if the covers are changed. Well I like that shriya and anushka pictures. To my eyes they are beautiful. The source of book is given in the book. Any one can download it, change the covers and redistribute it as this book is written under GFDL license.

Advertisements
 
Leave a comment

Posted by on December 6, 2013 in Free Software, I Love Ruby, Ruby

 

Tags: , , , , ,

Timestamps arent necessary

Oops this is my life’s blog, I have mistakenly wrote my Rails blog here, which has been moved to http://acupofrails.wordpress.com/2013/11/27/timestamps-arent-necessary/

 
 

Tags: , , ,

300 hits on day one

I Love Ruby 2012 cover

So, I just added loop to Loops section and released my Ruby programming book I Love Ruby yesterday about 5:00 PM Indian Time. You can get it on http://is.gd/ruby_buk . I set the is.gd url shortening service to track it. And the result is this http://is.gd/stats.php?url=ruby_buk , around 300 hits the first day. It baffled me.

Thank you people. Hope you benefit out it. I also thank The Pirate Bay. Without its Ebook section I would have never learned top class Ruby and never been inspired to share my work with the world. This book is absolutely free. Even its source is available. So share it with your friends, modify it, redistribute it.

About the covers

I Know many people in India, and those who haven’t seen a movie or a supermodel or a girl ever in their life have complained about the covers. All I can say to them is this: Stay young.

Whats More

If I have time (the universe is too chaotic to predict anything), I might add meta-programming chapter. Or meta-programming might be woven then and there in the book. Please write the comments about the book to my email mindaslab@gmail.com or join its facebook group https://www.facebook.com/pages/I-love-ruby/172269549451705

 

Tags: , , , ,

Very Simple Search for Active Records

Okay, you might encounter a need to put very simple search for active record / model in your Rails app and here is it. Put this code in your active record model:


##
# A simple search method
def self.search text
columns = [:name, :roll_no, :address, :city, :pin, :ph]
words = text.split(/\s+/)
query_array_2 = []
for word in words
query_array = []
for column in columns
query_array << "lower(#{column}) like '%#{word}%'"
end
query_array_2 << query_array.join(' or ')
end
query = query_array_2.collect{|e| "(#{e})"}.join(' and ')
self.where query
end

 
Leave a comment

Posted by on July 11, 2013 in Uncategorized

 

Tags: , , , ,

I Love Ruby 2013 released a long back

I Love Ruby 2012 cover

I Love Ruby 2013

Hello Ruby Folks,

I just noticed that I Love Ruby Book 2012 is getting lot of downloads from this blog (about 350 in two days). And it getting referenced from here. I just want to say I Love Ruby 2013 has been released,. Click here to get it. Bye.

And if you want the covers to be changed, here is a good suggestion. An ya sorry for not putting the latest release info in this blog. In 2013 June release I wish to get it Ruby 2.0 ready (that’s ridiculous as Ruby 1.9 is almost Ruby 2.0) . Any way the name jump will start another download frenzy and i can brag to my friends about it.

I am trying to write about the Struct in Ruby and Enum types. And that’s it. Enjoy life. And ya if any one can proof read book, spot mistakes, extend it, I will be very happy (provided this book is as free as in freedom).

 

Tags: , , , ,

 
%d bloggers like this: