Accessing Helper modules in rails

>Methods defined in Helper modules can directly accessed in rails views because this is what they are pretended for but we often come across with situations where we wanted to use some helper methods in controllers, views, models and mailers and obvious we don't want to repeat same lines of code everywhere which also rail … Continue reading Accessing Helper modules in rails

authlogic custom conditions for authentication

>To Add custom conditions to authlogic finders first of all we need to override authlogic find_by_login method.class UserSession < Authlogic::Session::Base  after_validation :check_if_verified  find_by_login_method :find_by_login_and_deleted_methodendThen we need to define overridden method inside User modelclass User < ActiveRecord::Base  acts_as_authentic  def self.find_by_login_and_deleted_method(login)    find_by_email_and_deleted(login, false)  endendgot easy..wooooooo 🙂

Overriding to_s method for BigDecimal instance

requirement was to display decimal numbers which are having scale values present to be displayed in decimal format otherwise display them as integer. Output expected 12.23 => 12.23 12.00 => 12 While rendering any object on html page by default "to_s" method gets executed.So, i overwrote "to_s" method of BigDecimal class as below. Anyone having … Continue reading Overriding to_s method for BigDecimal instance

Twinkle + FF Setup (Click To Call) using telify

On linux machine following settings needs to be done in order to get in browser calling enabledfor phone numbers.Installation setup1. Install twinkle setup (Create user profile) and get it working for outgoing and incoming calls2. Install telify add-on (can be un-installed once completed with all settings)3. Copy wrapper script twinkle_tel) click here to download and … Continue reading Twinkle + FF Setup (Click To Call) using telify