Archive for category Ruby
Saw this code posted by my friend. Thought it was worthy to tell many
I am very much fond of rvm http://rvm.io/ . All the apps I have deployed runs on it. RVM needs funding so that it can be developed further. I want to hasten the process of funding.
I have written a ruby programming book named ‘I Love Ruby’ thats totally free, you can get it here http://goo.gl/FW6slH (this book will be released on jan 2014 or earlier)
If you donate $2000 to RVM I will grant full page advertisement, half page for $1000 and quarter page ad for $500. If you have donated these amounts you can contact me on mindaslab at gmail dot com so that I can put your ad in it.
The advertisement will stay till Jan 31 2014. It must be designed by you.
Please donate to RVM by going to https://www.bountysource.com/fundraisers/489-rvm-2-0
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:
Note this line
columns = [:name, :address, :city, :pin, :ph]
in the code snippet, give your own column names in that array. This array can contain columns that are string and text type. Lets say you have put these stuff in a class called Person , to search it you need to issue a command like this
Person.search "Karthik chennai"
This stuff works well with Sqlite, Postgre and MySQL. If you have tried this out with other DB, please add it in comments. Bye.
Am ditching my Rails book. well, I am in a full time job now, in a kinda hot situation (not that girls here makes me hot), but some things makes my blood boil, like peoples insisting on using Windows and Ditching Linux. WHATTTTTTTTTTTT? Ya they say this and that for that. Plus there is ample things here to work on. So till my friends here become a programming Jedi, I wont be free.
Well, after the success of I Love Ruby( http://is.gd/ilr2013 ), I am planning fora Rails book. You can see its cover above 😉
This book will be released under GNU free documentation license. Time will tell if this book will become a success.
Hello people. One problem with Ruby and its spinoffs like Rails, Sinatra and blah blah is that its documentation, books, tutorials are scattered all over the internet. I was wondering could this all be got under one place. In fact Google has done it. But is googlean excellent vertical specific search engine and book marking thing? No. Well I present you with http://rubylinks.net .
This is not a search engine though, all you can do is, if you find a great link about Ruby and its allied technology, you can post it here. If soe one likes it, they can jewel it. You are presented with your own page here all the links posted and jeweled by you are listed, so that there is no need for you to scratch your head and say, “where did I see that?”
Ruby Links is a free software, hosted here https://github.com/codetribe/ruby_links , please post bugs and suggestions there, ad if possible contribute for the benefit of Ruby community.
If you are using the rvm for managing Ruby versions and are in Ruby 1.9.X version and want to upgrade to Ruby 2, this blog will help. So hoping that you have installed rvm on your system this is how you upgrade to Ruby 2.0
First in your bash / terminal you need to tell rvm to check for latest stable release of Ruby. For that type this command (of course without the $)
$ rvm get stable
This will update rvm with latest stable releases. Now you can get the list of known by typing this command
$ rvm list known
This will list some stuff like this
# MRI Rubies [ruby-]1.8.6[-p420] [ruby-]1.8.7[-p371] [ruby-]1.9.1[-p431] [ruby-]1.9.2[-p320] [ruby-]1.9.3-p125 [ruby-]1.9.3-p194 [ruby-]1.9.3-p286 [ruby-]1.9.3-p327 [ruby-]1.9.3-p362 [ruby-]1.9.3-p374 [ruby-]1.9.3-p385 [ruby-]1.9.3-[p392] [ruby-]1.9.3-head [ruby-]2.0.0-rc1 [ruby-]2.0.0-rc2 [ruby-]2.0.0[-p0] ruby-head
Notice that you have [ruby-]2.0.0[-p0] which is nothing but but Ruby 2.0,to install it type this
$ rvm install 2.0.0
Once installed to use Ruby 2.0 just type this
$ rvm use 2.0.0
Now how to switch to other versions of Ruby, well just type
$ rvm list
This will list the versions of ruby available in your system, the following is the out put in my system
rvm rubies =* ruby-1.9.3-p362 [ x86_64 ] ruby-2.0.0-p0 [ x86_64 ] # => - current # =* - current && default # * - default
This shows I have Ruby 2.0 and Ruby 1.9.3-p362. To switch to Ruby 1.9.3-p362 (in my case) type
$ rvm use 1.9.3-p362
and you would have switched to that version of Ruby!!!