Skip navigation

Category Archives: Rails

I tried to write my own plugin to do simple searches when I realized that all I needed was a search extension. Since mozilla adopted the opensearch standard, integrating your custom search hasn’t been easier. Sandro Paganotti wrote a pretty straight forward article on how to create your own custom mozilla search extension (http://www.railsonwave.com/railsonwave/2007/2/21/tutorial-opensearch-with-rails-1-2-render-json) Its actually a lot simpler than you might think.

Once implemented, don’t be alarmed if you don’t get an immediate prompt or automatic install of your newly created search extension. Those prompts are made possible through a little bit of javascript. Just look under your search bar and it should say “Add ‘your search extension name'”. Or if you want the browser to prompt you for search extension install, use the “addSearchEngine” function

addSearchEngine(engine URL, icon URL, engine name, category name)

Feeds are just glorified xml… just keep with the syntax and let the browser handle the rest. Whether its RSS2 or atom, google for the xml syntax and there you have it. Handling the different requests on the controller end is another story. But not too bad. With help of rails’s respond_to (http://rails.raaum.org/actionview.html) you can dynamically render different formats without repeating any code and adhearing to the DRY method Rails is built on.

Atom : http://snippets.dzone.com/posts/show/559

RSS2: http://snippets.dzone.com/posts/show/558

So apparently, whenever you launch a rails application in production mode a copy of your app is actually used. So any changes that you make are not seen on the other side until you restart the web server. . .  It was very frustrating figuring this one out.