Posts

Showing posts from September, 2011

How to remove big Facebooklogo in the starting of Application using omniauth gem

Rails.application.config.middleware.use OmniAuth::Builder do provider :facebook, 'YOURAPPID', 'YOURAPPSECRET', :iframe => true, :scope => "publish_stream,email,user_education_history" end # add this OmniAuth.config.full_host = ' http://apps.facebook.com/yourapp/ '

Caching in Rails

Image
you can find this documentation in http://blazingcloud.net/2010/11/21/caching-in-rails/ Caching in Rails In Rails we have two different ways of Caching - Page Caching: which is always stored on Disk - Action & Fragment Caching: which uses the configure cache configured in our Rails instance. By default Rails provides three techniques: 1) Page Caching Allows the request for a generated page to be fulfilled by the webserver, without ever having to go to your RoR application. In other words if you have page caching turned on,  the request will come in, go to Mongrel, the page will then be generated, and then sends  it back to apache.  Additionally,  it will be stored in a local file system. Next time we request the same page, apache will load the page from the filesystem and send it back to the client, without your Rails application being

Ruby on Rails usage big companies

I have seen all ruby on rails usage big companies in below three websites. http://blog.obiefernandez.com/content/2008/03/big-name-compan.html http://www.workingwithrails.com/high-profile-organisations http://rails100.pbworks.com/w/page/8815413/FrontPage

Ruby exception handling

begin result = risky_operation rescue StandardError => e puts "Risky operation FAILED: #{e}" end

Rspec Documentation

RSPEC RSpec is a great tool in the behavior driven design process of writing human readable specifications that direct and validate the development of your application. I've found the following practices helpful in writing elegant and maintainable specifications. First #describe What You Are Doing Begin by using #describe for each of the methods you plan on defining, passing the method’s name as the argument. For class method specs prefix a "." to the name, and for instance level specs prefix a "#". This follows standard Ruby documentation practices and will read well when output by the spec runner. describe User do describe '.authenticate' do end describe '.admins' do end describe '#admin?' do end describe '#name' do end end Then Establish The #context Next use #context to explain the different scenarios in which the method could be exe