Featured
-
Installing RVM and Creation of Gemsets Part 2
In the last tutorial we learnt how to install RVM.
by dinesh.singh -
Installing RVM and Creating of Gemsets Part 1
Installing RVM and creating Gemsets can be difficu
by dinesh.singh -
Use pik in Windows
Managing multiple versions of Ruby on Windows can
by anirudh.rautela -
Using Bundler in Rails 2.3.x app
Managing Gems in Rails can be infuriating at times
by anirudh.rautela
Tags
Arrays and Hash In Ruby
Ruby's arrays and hashes collections having indexes. They can also be said as indexed collections.
Arrays and hashes store collections of objects which can be accessed using a key.
Both arrays and hashes grow as needed to hold...
Iterators and its usage in ruby
In Ruby, iterators are methods basically used by the collections. Collections are a set of objects. Hashes & Arrays are the example of collections. Iteration is a process by which we can get or set the elements in collections. We will discuss...
Few Important Hash Methods in Ruby
Hash:
Hashes are way of storing data in key-value pair format. Key can be any ruby object ( i.e. string, numbers ). Here we will see some of mostly used methods for hashes.
1) Creating/Initializing a hash:
Hash can be created i...
Hash Conditions in Active Records (Rails)
Hash Conditions in Active Records (Rails)
Active records allows us to to pass in array conditions to our query to fetch a single record or all the records matching
the key value pair. In these hash conditions we pass the key as the na...
Ruby Sort an array of objects in hash with case insensitive attribute
To sort an array of objects in hash
@users = User.find(:all)
@users.sort_by(&:employee_name)
Above code will sort @users object with all employee name with Capital letter first and then small letter.
...
How to keep the order in ruby hashes
When we insert the data into a ruby hash it reorders the data in some other order when we use it in view file.So there are cases when we have to show the data in the same order in the order we are inserting the data into ruby hash.So in case wher...