Something like x.instance_variables.each.... { |i} .... }
x.instance_variables.each.... { |i} .... }
Thought to be a one liner. I can't figure out how to apply strip() to each variable, since instance_variable_get returns the value. I really want something I can apply .strip! to....
In the following code -
require 'active_record' class Order < ActiveRecord::Base end order = Order.find(1) ...
As per http://api.rubyonrails.org/ find() is an instance public method. So why can we call Order.find(1) here? Shouldn't it be Order.new.find(1)?
I have deployed a ruby on rails app on two instances of production server, now there are two separate log file are being created for different instances. My question is how I can make a single log file for both the instances?
I have a table with several thousand records in it. They take a long time to load and are essentially useless presented altogether.. I'd like present the user a search form to select a limited subset of records for display in the index function. What options are available to solve this problem and where might I look for examples or demos?
I want to create 3 rails apps in which every app has a Google API. 1) Gmail API 2) Google+ API 3 3) Google calendar API
Please suggest how to begin with...