How to know scroll position reached bottom using jquery

Implemented as below: Suppose we have a “DIV” tag with some content, <div id=”scrollbox”> Lorem ipsum dolor sit amet <br> Consectetuer augue nibh lacus at <br> Pretium Donec felis dolor penatibus <br> Phasellus consequat Vivamus dui lacinia <br> Ornare nonummy laoreet lacus Donec <br> Ut ut libero Curabitur id <br> Dui pretium hendrerit sapien Pellentesque […]

How to integrate MongoDB in rails 3.X

Mongodb MongoDB permits a one-to-one mapping between object-oriented (OO) software objects and database entities. MongoDB is a document database that focuses on developer needs. MongoMapper, a project by Jon Nunemaker from Github, is a simple ORM for MongoDB Mongoid, in particular, has become quite popular since its creation 4 years ago by Durran Jordan. Mongoid’s […]

Installing Google Analytics into a Ruby on Rails 3.X

Installing Google Analytics into a Ruby on Rails app is pretty straight forward, however, the key is to only execute the analytics script in PRODUCTION environment. Without doing this, you’ll end up counting page views and visits on all your environments, e.g. development and test. Step – 1 Go to Google Analytics to create an […]

How to Automate Copyright Notice Updates in RubyonRails

Suppose you want to automate the update process in a website written in RubyonRails.Here is one way to do it with a simple layout helper function. In helpers/layout_helper.rb: def copyright_notice_year_range(start_year) # In case the input was not a number (nil.to_i will return a 0) start_year = start_year.to_i # Get the current year from the system […]

ActionView::Template::Error (undefined local variable or method `bootstrap_flash’ in production mode

Create a helper file as,   app/helpers/bootstrap_flash_helper.rb Add these snippet into the file, ——————————————————————————– module BootstrapFlashHelper ALERT_TYPES = [:error, :info, :success, :warning] def bootstrap_flash flash_messages = [] flash.each do |type, message| # Skip empty messages, e.g. for devise messages set to nothing in a locale file. next if message.blank? type = :success if type == :notice […]