Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

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. ...

Removing file using Spreadsheet in windows( Errno::EACCESS(Permission denied))

There is no close method in spreadsheet.If you opened the spreadsheet and after reading you need to delete it then FIleUtils.rm(file_name) will work smoothly in linux but in windows it will give permission error Errno::EACCESS(Permission den...

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...

Format floating number

"%g" % (float_number) Above function formats float number to natural number if it contains zero's after decimal point otherwise format float upto one decimal point Helpful in showing working days(like 22.5 days)

Upload image in ruby on rails through AJAX

Upload image in ruby on rails through AJAX This is HTML and JavaScript code. <% remote_form_for(:image_upload_form, :url => "/meeting/save_image/", :html => { :method => :post, :id => 'imgForm', :multipart => true }) do |f...

Sending private messages to Facebook users

Many of us have this requirement of sending private message to your facebook friends and we usally struggle to get it done. The main reason behind this is that graph api provided by facebook does not provide this. We have to look for other option...

Installing RVM and Creation of Gemsets Part 2

In the last tutorial we learnt how to install RVM. In this one we will take one step further by creating Gemsets. Note - Gemsets are used to eliminate Gem clutter and version mismatches. Also by creating Gemsets we can install multiple version...

Installing RVM and Creating of Gemsets Part 1

Installing RVM and creating Gemsets can be difficult at times. Frown not because in this tutorial we will learn the basics of installing RVM and in part 2 of the tutorial we will be creating Gemsets. Quick Revision RVM helps to manage multi...

Use pik in Windows

Managing multiple versions of Ruby on Windows can be a harrowing task since RVM is not present for Windows environment. And suppose you want to install different projects which require different version of Ruby and Rails on Windows. Can be a ...

Using Bundler in Rails 2.3.x app

Managing Gems in Rails can be infuriating at times especially when Bundler is not present. That is what happens when you use Rails version lower than 3 as it does not come bundled with Bundler. A quick fresh up though as why we use Bundler - ...
1 8 10 next
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: