模板覆盖
Every template in ActiveScaffold can be overridden with your own. Just find the template (anything in ActiveScaffolds’ frontends/default/views directory) you want to customize and copy it to your app/ folder. If you want to override the template for all controllers, copy it into the app/views/active_scaffold_overrides/ directory. If you want to override the template for a specific controller, copy it into that controller’s directory (e.g. app/views/users/ for the UsersController).
在ActiveScaffold中每个模版都可以自己重写。只要找到你想要定制的模板(在ActiveScaffold前端的任何东西/default/views目录),然后将它拷贝到你的app/文件夹。如果想要为所有的控制器覆盖模板,则将它拷贝到app/views/active_scaffold_overrides/目录。如果想为一个特定的控制器覆盖模板,则将它拷贝到控制器目录(例如 app/views/users/ 用户控制器文件夹)。
If you don’t want to completely override a template but instead wrap it, you can create a file in one of the same two places with the same name, but somewhere in the template make a call to render :super. This special syntax, provided by ActiveScaffold, will bypass all other overrides and render directly from the current frontend.
如果你并不想完全地覆盖模板,而只是想包装模板,可以在两个相同的地方中的任选一个,以相同的名字创建一个文件,但是在模板的某处建立一个render :super的调用。这个由ActiveScaffold提供的特殊语法,将绕过其他的覆盖直接由当前端提供。
