Tag view

3 votes

0 comments

2089 views

model.collection_model_ids (many-to-many)

When you want to associate a model to many association models by checkbox on view, you should take advantage of model.collection_model_ids to reduce the code in controller.

by ihower
ihower

6 votes

2 comments

3719 views

Nested Model Forms

Use accepts_nested_attributes_for to make nested model forms much easier, this feature is provided by rails 2.3

by ihower
ihower

10 votes

0 comments

3014 views

Move code into controller

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

implemented
by ihower
ihower

10 votes

8 comments

3570 views

Move code into model

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

implemented
by ihower
ihower

9 votes

1 comments

3369 views

Move code into helper

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

implemented
by ihower
ihower

19 votes

9 comments

6950 views

Replace instance variable with local variable

In partial view, we can use the instance variable directly, but it may be confused and make it hard to reuse anywhere, because we don't know exactly which instance variable can be used, so use the local variable in partial with explicitly assignment.

implemented
by ihower
ihower

5 votes

2 comments

8422 views

hjuskewycz

5 votes

2 comments

3611 views

abuse content_for

Use content_for for grouping html contents like javascript and css

by jvnill
jvnill

8 votes

6 comments

3007 views

use OpenStruct when advance search

use OpenStruct when advance search

alvin2ye

8 votes

1 comments

4845 views

Put scripts at the bottom

Do you experience that your website renders slow due to loading a lot of javascripts, especially loading some third-party javascripts? Move script tags to the bottom of body can speed up the render of your website.

flyerhzm
Fork me on GitHub