• 博客访问: 1047911
  • 博文数量: 526
  • 用 户 组: 普通用户
  • 注册时间: 1970-01-01 08:00
个人简介

鏆傛棤浠嬬粛

ITPUB论坛APP

ITPUB论坛APP



APP发帖 享双倍积分

文章分类

全部博文(526)

文章存档

2007年(3)

2006年(523)

我的朋友
微信关注

IT168企业级官微



微信号:IT168qiye



系统架构师大会



微信号:SACC2013

发布时间:2006-11-10 19:12:09

Rails的RJS模板十四 [@more@]第六节 Creating the Views – 创建视图 现在我们还没有用于查看这个project的视图。我们需要创建一个视图来为我们刚刚创建的Project显示Expense对象。视图被分隔在一个模板及两个局部模板内。我们特别分隔出_expense.rhtml局部模板,以便我们在用RJS更新表时能渲染一个单独的记录行。 There isn't yet a way for us to view our expenses for this Project. We need to create a view that shows the Expense objects for the sample Project that was just created. The views are separated ......【阅读全文】

阅读(1183) | 评论(0) | 转发(0)

发布时间:2006-11-10 19:10:23

Rails的RJS模板十三 [@more@]第三节 Setting Up a Route – 配置路由器 创建好看的URL。控制器使用存储在params[:project]内的值来查找project。我们需要添加一个简单的路由来捕获它,并且产生一个优美的URL路径,像/project/1/expenses/new。 One more step is needed to wire up the before_filter and create nice-looking URLs. The controller looks up the project using the value stored in params[:project]. We need to add a simple route to catch this and produce nice URL paths like /projects/1/expenses......【阅读全文】

阅读(1361) | 评论(0) | 转发(0)

发布时间:2006-11-10 19:09:26

Rails的RJS模板十二 [@more@]第二节 Defining the Controllers – 定义控制器 我们生成两个控制器。第一个控制器用于projects,第二个用于expenses。 Let's generate two controllers. The first controller is for projects and the second is for expenses. expenses> ruby script/generate controller Projects exists app/controllers/ exists app/helpers/ create app/views/projects exists test/functional/ create app/controllers/projects_c......【阅读全文】

阅读(910) | 评论(0) | 转发(0)

发布时间:2006-11-10 19:06:53

第四章 RJS in Practice: The Expense Tracker [@more@] 迄今为止我们已完成"Thought Log"应用程序,并看到了RJS是如何整合到Rails内的。现在的时间是检验一个例子,该例子会更现实并解决一些你可能在你自己的实际工程内可能遇到的问题。 So far we have completed the "Thought Log" application and taken a look at how RJS fits into the Rails framework. Now it is time to examine an example that is a bit more realistic and solves some of the problems that you might actually run int......【阅读全文】

阅读(1037) | 评论(0) | 转发(0)

发布时间:2006-11-10 19:04:02

Rails的RJS模板十 [@more@]4、remote_function(options) 生成 JavaScript 来产生一个后台 Ajax 请求给一个远程的控制器动作。这个方法对从DOM对象的事件处理程序生成Ajax调用是很有用的,比如<select>标记的onchange()事件。接受选项与 link_to_remote() 一致。 Generates the JavaScript to make a background Ajax request to a remote controller action. This method is useful for making remote Ajax calls from the event handlers of DOM objects, such as the onchange() event of a <select> tag. Takes......【阅读全文】

阅读(1615) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册