Site Archives Rails
Installing gem on Leopard
May be you guys have noticed that when you try to install a new gem on your machine it says some thing like “Updating meta data for 500 gems” and display one dot per gem. These dots moves very slowly and stops in some time.
I faced this situation many times and found a solution […]
When Ultrasphinx is used with polymorphic associations…
Lets first consider simple has_many and belongs_to associations as:
class Article < ActiveRecord::Base
has_many :comments
end
class Comment < ActiveRecord::Base
belongs_to :article
end
Now if you wish to index the title of associated article with comment for searching, you just need to add ” is_indexed :fields => :body, :include => [{ :association_name => ‘article’, :field => ‘title’, :as=> […]
When Ultrasphinx is used with STI…
Hi Guys, it has been a long time since I last posted. I had worked on several things since then, and have couple of posts pending/draft. One of those posts is related to Ultrasphinx, when it is used with STI models.
For those who are new to Ultrasphinx: Ultrasphinx is a rails plugin and client to […]
Git Error: trailing whitespace, indent SP followed by a TAB, unresolved merge conflict
I have been using Git from last few days, and faced following errors while committing:
1) Trailing whitespace
2) Indent SP followed by a TAB
3) Unresolved merge conflict
The first error “Trailing whitespace” is because of carriage-return/line-feed(windows style line feed/end). To resolve this problem comment following lines(58-60) in .git/hooks/pre-commit file:
if (/\s$/) {
bad_line(”trailing […]
Rails Plugin Annotate Models For Spec And Spec Fixtures
I have been using “Annotate Models” rails plugin written by Dave Thomas since I found it around one and half year ago. It really helps while writing fixtures. But if you use RSpec you might miss schema info at the top of your rspec fixture file as I do. So, today I modify the plugin […]
Find It Quickly
Find what you're looking for quickly by using our keyword search. Can't find it? Try our links below.


