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
Tags
helper
javascript
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
Tags
helper
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
Tags
view
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
Tags
view
helper