Author Archives: sandipransing

About sandipransing

Web Developer #ruby #rails #JS

DelayedJOb’s (DJ) fancy methods

Delayed Job provide send_later and send_at as instance methods along-with handle_asynchronously as class method Advertisements

Posted in Ruby on Rails | Tagged | Leave a comment

Solution to DelayedJob(DJ) gem server start problem

Solution to DelayedJob(DJ) gem server start problem I had installed delayed_job gem 2.0.3, daemons gem but after staring DJ server it shows daemon started but actually process gets killed automatically.I performed steps given by Kevin on google group and it … Continue reading

Posted in Ruby on Rails | Tagged | 15 Comments

Introduction To Delayed Job

Check out this SlideShare Presentation: Introduction To Delayed Jobhttp://static.slidesharecdn.com/swf/ssplayer2.swf?doc=introtodelayedjob-091110110012-phpapp01&stripped_title=introduction-to-delayed-job&userName=jonathanjulian View more presentations from Jonathan Julian.

Posted in Ruby on Rails | Tagged | 1 Comment

Best ways to populate dynamic array of numbers in ruby

Array of years using range((yr=Date.current.year)-9..yr).to_a#=> [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010]Array of years using lambda Array.new(10){|i| Date.current.year-i}#=> [2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001]Array of monthsDate::MONTHNAMES.compact#=> [“January”, “February”, “March”, “April”, “May”, “June”, “July”, … Continue reading

Posted in Ruby | 1 Comment

Rails 3 Beautiful Code

Check out this SlideShare Presentation: Rails 3 Beautiful Codehttp://static.slidesharecdn.com/swf/ssplayer2.swf?doc=beautifulcodeinrails3-greggpollack-100218130149-phpapp02&stripped_title=rails-3-beautiful-code-3219240 View more presentations from GreggPollack.

Posted in General | Leave a comment

Zipcode validation using geokit in rails

1.Install geokit gemgem install geokitOR # Add following line inside rails initialize blockRails::Initializer.run do |config| config.gem ‘geokit’endAnd then run commandrake gems:install2. Consider User model with zipcode as attribute fieldinclude Geokit::Geocoders class User :zipcode private def request_zipcode_validation_using_geokit # Method request google … Continue reading

Posted in Ruby | Leave a comment

ActionMailer SMTP settings in rails

1. Add following line to rails environment file ActionMailer::Base.delivery_method = :smtp2. Include your email authenticationCreate a ruby file called smtp_settings under config/initializers directory# config/initializers/smtp_settings.rbActionMailer::Base.smtp_settings = { :address => “smtp.gmail.com”, :port => 587, :authentication => :plain, :enable_starttls_auto => true, :user_name => … Continue reading

Posted in Ruby on Rails | Tagged | Leave a comment