Calling expire_fragment within rails console

Today i want to expire a fragment cache in haml view: -cache(‘taxonomy’) do So I enter in rails c production, but I found Rails.cache.exists?(‘taxonomy’) returned false. expire_fragment doesn’t exist in ActionController::Caching::Sweeper. It can be found in ActionController::Base. The sweeper class uses method_missing to call the method from a controller instance. ActionController::Base.new.expire_fragment(‘taxonomy’, options = nil)  That’s why everything was fine when I Read More

Our life around REPL – Read–Eval–Print Loop

Whenever I see my niece so comfortable with iPhone, Mac, Advance Toys; I usually wonder almost similar feeling our parents must have pondered about us. But what is the biggest disadvantage of being part of GEN X. What? We have best things in the world but the irony is that we don’t enjoy or embrace Read More

Magical ‘If..then..else’ conditional statement

I believe whole programming world stands on couple of pillars and ‘if..then..else’ (ITE) statement is one of those. Everyone programmer and non-programmer understands ITE conditional statement for sure.  A typical if..then..else.. statement in Ruby: if 1 == 2    puts “inside if statement” else    puts “inside else statement” end 1.9.3p385  > inside else statement Another Read More

RubyMotion Runtime Guide

Object Model   The object model of RubyMotion is based on Objective-C, the underlying language runtime of the iOS and OS X SDK. Objective-C is an object-oriented flavor of C that has been, like Ruby, heavily influenced by the Smalltalk language. Sharing a common ancestor, the object models of Ruby and Objective-C are conceptually similar. For Read More

1 2 3 4