To create the new view and controller, type the code in Listing 5.
创建新的视图和控制器,请输入清单5所示的代码。
The controller can specify a code block for each type the controller expects.
控制器可以为控制器期望的每个类型指定一个代码块。
The idea behind the controller is to provide code that can use XQJ to query and transform the aforementioned XML document.
控制器的目的就是提供能够使用XQJ进行查询的代码,并转换刚才提到的XML文档的格式。
It should be ignorant of any view or controller code that exists as a means to interact with the model.
视图或控制器用于作为与模型进行交互的手段,而模型并不知道它们的存在。
This code was leveraged from the activity controller with only a few modifications, including echoing the final table, not returning it.
这段代码在活动控制器中使用,并且只进行了少量修改,包括回传最终表(而不是返回表)。
The top half of this file will contain the primary code for your scripts controller.
此文件的上半部分将包含脚本控制器的主要代码。
If you need to change the path that executes a given controller, you need to reconfigure your code structure.
如果我们需要修改执行给定控制器的路径,就需要对代码结构重新进行配置。
The code in Listing 3 is the basic declaration of your controller.
清单3中的代码是您的控制器的基本声明。
Programmers have simplified their code structure and eased maintenance tasks with Model-View-Controller for decades.
数十年来,程序员们使用模型-视图-控制器简化了代码结构,并使得维护任务更加容易。
You will need some controller code to glue everything together and make this RIA interactive.
您需要使用一些控制器代码将所有内容组合起来,并使这个RIA具有交互性。
To generate more-descriptive URIs, you'll customize controller code to support the personalized URIs.
要获得描述性更好的URI,需要定制控制器代码以支持个性化的 URI。
That code belongs in the controller.
那些代码属于控制器。
Now, add more code to the controller.
现在,您可以向控制器中添加更多的代码。
Listing 4 shows the source code for this controller.
清单4展示了该控制器的源代码。
The event bubbling technique provides the ability to disconnect the view structure of the widget from the controller code.
事件气泡技巧可用于断开小组件的视图结构与控制器代码之间的连接。
Modify the controller to validate the ZIP code (5 numeric digits).
修改控制器以验证邮政区码(5位数字)。
As you can see from the link definition in Listing 5, I created a new BrowsersController controller class to manage this code.
正如您可以从清单5中的链接定义看到的那样,我创建了一个新BrowsersController控制器类来管理这段代码。
With one line of code, the catalog controller can now use the requester-side caching capabilities for caching the catalogs returned from the legacy catalog application.
现在只需使用一行代码,Catalog控制器就能够使用请求端缓存功能来缓存从遗留Catalog应用程序返回的Catalog了。
Model View Controller for code generation.
用于代码生成的模型-视图-控制器模式。
Rails helpers are functions that help to simplify model, view, or controller code.
Rails帮助器是帮助简化模型、视图、控制器代码的函数。
Next, to receive the form post, add the function update() to the Student controller; the code is shown in Listing 19.
接下来,为了接收这个表单发布,向Student控制器添加函数update();代码如清单19 所示。
Convention over configuration also leads to "aha!" moments for new Rails developers because the controller and model code is so concise.
约定优于配置也会使新的Rails开发人员能够立即上手,因为控制器和模型代码特别简洁。
When a user clicks on a closed node, the onClick event of the target node is bubbled up by the browser to the main onClick handler of the widget's controller code.
当用户单击某个关闭的节点时,浏览器会将目标节点的onClick事件(通过气泡)传递给小组件控制器代码的主onclick处理程序。
You saw how to create friendly URIs by adjusting controller code, add mappings to UrlMappings.groovy, and create a custom codec.
您了解了如何通过调整控制器代码创建更为友好的URI、向UrlMappings . groovy添加映射以及创建一个定制codec。
The view action for the Products controller should have something like the code in Listing 3.
在控制器的view操作中,应当有清单3所示的代码。
Begin by replacing the code that creates the Edit option in the Student controller listing function with the code from listing 21.
首先用清单21中的代码代替用来创建Student控制器的listing函数内的Edit选项的那些代码。
You might recall that these are the same three variables that were bound to values within the controller code.
您可能还记得,它们就是在控制器代码中被绑定到值的3个变量。
The controller class contains the code the Web service makes available to a client.
该控制器类包含可用于客户机的Web服务代码。
Groovlets make controller coding a snap: they require less code and provide needed objects automatically.
Groovlets使得编写控制器变得非常简单:它们需要更少的代码并自动提供了所需的对象。
The code for a controller in Rails 3 can be exceedingly Spartan.
Rails3中的控制器代码可以极其简单。
应用推荐