Yearly Archives: 2014

Issues with thinking sphinx

I recently faced some issues with thinking sphinx which sharing here so that it helps others. Has many association not working: I had a model named User which has many tracks and the very basic index definition is as follows: ThinkingSphinx::Index.define :track, :with => :active_record do indexes title indexes [artist.first_name, artist.last_name], :as => :artist_name, :sortable…

Read More

Dirty checking to warn for unsaved changes using jQuery

Copy following code snippet into the application. dirtyCount() method return the number of fields have unsaved changes. var dirtyChecking = function () { $(‘input, select, textarea’).each(function () { var ele = $(this); ele.attr(‘data-old’, ele.val()); // Look for changes in the value ele.on(“change keyup paste click”, function (event) { if (ele.attr(‘data-old’) != ele.val()) { ele.addClass(‘unsaved’); }…

Read More