31 May 2011
Guo Lei
Make the app/models more clear using namespaced models
Read More
Tags
model
31 May 2011
Guo Lei
When the business logic of models becomes complex, it's very helpful to keep a consistent code structure that is agreed by team members.
Read More
Tags
model
04 May 2011
Richard Huang
the routes will become complicated with the growth of your application, contain different namespaces, each with a lot of resources and custom routes, it would be better to split routes into different files according to the namespaces, which makes it easy to maintain the complicated routes.
Read More
Tags
route
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 Jan 2011
Richard Huang
Are you tired of going to schema.rb to find your table structures information? It would be better to list all the attributes of the model in the model itself.
Read More
Tags
model
gem
comment
12 Jan 2011
Richard Huang
If you want to process something expensive as part of a web request, it will delay the response. If the job is not critical, it's wiser to move the expensive to a background queue and returns the response immediately.
Read More
Tags
background job
19 Dec 2010
Richard Huang
Ruby/Rails provides a lot of magic codes, especially for metaprogramming, they are powerful, less codes to implement more functions, but they are not intuition, you should write good comment for your magic codes.
Read More
Tags
convention
comment
12 Dec 2010
Richard Huang
Like the simplify render in views, from rails 2.3, we can also simplify render in controllers.
Read More
Tags
controller
04 Dec 2010
Richard Huang
render is one of the often used view helpers, we can pass object, collection or local variables. From rails 2.3, more simplified syntax for render are provided.
Read More
Tags
view
partial
02 Dec 2010
Richard Huang
Trailing whitespace always makes noises in version control system, it is meaningless. We should remove trailing whitespace to avoid annoying other team members.
Read More
Tags
whitespace
version control