Today I found two best API sites. One is http://www.gotapi.com.
This site provides APIs of almost all languages.
The other API site which is only focused on Rails is http://www.railsbrain.com/. I like this most. You can also download this API. It is AJAX based fast, useful.
Archive for the 'RubyonRails' Category
Consider a case of STI where:
class User < ActiveRecord::Base
validates_uniqueness_of :name
end
class Customer < User
end
class Manager < User
end
Now try following at console:
User.create(:name => “Akhil Bansal”)
Manager.create(:name => “Akhil Bansal”)
Customer.create(:name => “Akhil Bansal”)
This will let you create three records in users table with same name, validates_uniqueness_of written in User class has no effect on it. validates_uniqueness_of automatically [...]
Hours ago, I posted about, “How to deploy rails application with pound as a Balancer”.
Lets run rails application on https with pound. For that your machine should have:
* Pound installed with ssl support
* Pound and mongrels running
Now, First of all we need a ssl certificate, that can be generate by issuing “openssl req -x509 -newkey [...]
Now a days Apache + mod_proxy + mongrel_clusters, Lighttpd + Mongrel cluster and Nginx + mongrel cluster are well known for deploying rails applications.
You can also deploy your rails application with pound(a reverse proxy, load balancer and HTTPS front-end for Web server).
First you need to setup mongrel_clusters for your rails application by issuing [...]
I was using acts_as_searchable for one of my project, which uses Hyperestraier in background. Yesterday I decided to use acts_as_solr which uses solr(based on Lucene Java search library). I did all written in its Manual/Readme, but when I issued
rake solr:start
to start the solr server, it threw a heart breaking “Bad file descriptor” error, [...]