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 […]

‘Confirmation token is invalid’ when confirming after registering in Devise gem

I got stuck for sometime by getting the issue. When registering a new user with :confirmable in my devise user model, when the user clicks on the e-mail confirmation link, they receive an “Invalid confirmation token” error message Found some solution by searching about this, config.allow_insecure_token_lookup = true (Never do it in your devise initilizer […]

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 […]

Implementation of “Backbone.js” in Rails 3.X

Introduction Build snappier, more interactive apps with cleaner code and better tests in less time. Backbone.js is a great way to organize client Javascript code into MVC (model, view, controller) pattern that Rails server application uses. Just like in Rails, It use models to represent data, views to render the data, and controllers to coordinate […]

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 […]