Tag helper
9 votes
2 comments
3891 views
According to MVC architecture, there should not be logic codes in view, in this practice, I will introduce you to move codes into helper.
implemented9 votes
4 comments
6082 views
If you want to generate different urls according to different objects, you should use the polymorphic_path/polymorphic_url to simplify the url generation.
11 votes
10 comments
5067 views
Substituting before_filter :load_object
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.
13 votes
6 comments
6218 views
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.
implemented11 votes
8 comments
6262 views
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.
implemented