Monthly Archives: October 2011

rcov in rails

1) gem install rcov 2) rcov -o test/rcov -Itest test/functional/*.rb test/integration/*.rb -o test/rcov :- mentioning output directory where result files created. -Itest :- to mention where “test_helper” reside test/functional/*.rb test/integration/*.rb :- location where test files resides, here mentioned two locations … Continue reading

Posted in rails, ROR, ruby on rails, web development | Tagged , , , | Leave a comment

Exception Handling and sending error mail in rails 3

1) Add the following to the top of “application_controller.rb” rescue_from Exception, :with => :handle_exceptions private def handle_exceptions(e) ErrorMailer.experror(e).deliver render :template => “error_mailer/500”, :status => 500 end 2) configuring the maill In app/mailers folder’s error_mailer.rb file add the following( refer how … Continue reading

Posted in rails, ROR, ruby on rails, web development | Tagged , , | 1 Comment

how full error reports are disabled while exception occure in rails

problem is how to raise “500.html” instead of standard whole error report 1)set local request as false as shown in below Each environment has this value. so if it wanted in production mode.  change  configuration/environments/production.rb   only. config.consider_all_requests_local       = false 2)override … Continue reading

Posted in rails, ROR, ruby on rails, web development | Tagged , , | Leave a comment

Configure Rails 3 for HAML Generator

1) Add to gemfiles gem “haml-rails”, “~> 0.3.4” 2) scaffold something. now it creates haml views example- rails generate scaffold Post http://www.klairvoyant.in

Posted in rails, ROR, ruby on rails, web development | Tagged , , | Leave a comment

Rails 3 using compass with blueprint

1)gem install compass 2)compass create /path/to/project –using blueprint 3)To add blueprint and compass to a Rails project: compass init rails –using blueprint 4)Add the following to your Gemfile: gem “compass”, “>= 0.11.5” 5)restart your server.Sass will automatically compile your stylesheets … Continue reading

Posted in rails, ROR, ruby on rails | Tagged , , , | Leave a comment

SCSS in Rails 3

1) add following to gemfile gem “sass” 2) Create a folder  “sass” in public/stylesheets/ 3) Put your .sass files into public/stylesheets/sass and they will be converted to CSS when your application starts up. 4) what scss is doing is makeing … Continue reading

Posted in ROR, ruby on rails | Tagged , , | Leave a comment

Running Particular test files

Running a test is as simple as invoking the file containing the test cases through Ruby: $ ruby -Itest test/unit/post_test.rb Note that test_helper.rb is in the test directory, hence this directory needs to be added to the load path using … Continue reading

Posted in rails, ROR, ruby on rails | Tagged , | Leave a comment

How to get data from heroku to your system

1) Install the latest heroku gem 2) Install taps gem 3) execute the command heroku db:pull for more 1) http://devcenter.heroku.com/articles/taps 2) http://blog.heroku.com/archives/2009/3/18/push_and_pull_databases_to_and_from_heroku/ http://www.klairvoyant.in

Posted in rails, ruby on rails | Tagged , , | Leave a comment