Friday, March 09, 2007

Basics of Veiw

A View is an ERb program that shares data with Controllers through mutually accessible Variables. 首先,view是一个ERb程序。然后,View同Controller共享数据(通过Variable)。

Controller actions and View template files are connected through naming conventions:
An incoming request for the picture/display Action triggers execution of the display method in the picture Controller, followed by rendering of the picture/display.rhtml file in the Views area.

Basicly, the Controller prepares the data and stores it in Variables, and those Variables are used in the ERb file corresponding to that Action.

No comments: