Fork me on GitHub


    Not use time_ago_in_words

    10 Feb 2012

    Richard Huang (

    It's very common for a rails developer to use time_ago_in_words to display time like "5 minutes ago", but it's too expensive to calculate the time in server side, you should utilize client cpu to calculate the time ago. Read More


    Remove empty helpers

    09 Apr 2011

    Richard Huang (

    If you use rails generator to create scaffolds or controllers, it will also create some helpers, most of the helpers are useless, just remove them. Read More


    Substituting before_filter :load_object

    12 Oct 2010


    Instead of loading an object with a before_filter you can use a more intelligent helper_method to get the main object for the controller context. Read More


    Generate polymorphic url

    23 Sep 2010

    Richard Huang (

    If you want to generate different urls according to different objects, you should use the polymorphic_path/polymorphic_url to simplify the url generation. Read More


    Move code into helper

    24 Jul 2010

    Wen-Tien Chang (

    According to MVC architecture, there should not be logic codes in view, in this practice, I will introduce you to move codes into helper. Read More