如何通过rails插件使用ajax_scaffold?
下载ajax_scaffold插件直接拷贝到vendor/plugins目录下即可
然后在控制类里写入:ajax_scaffold:model
view/layout目录里放置model.rhtml
内容为:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>Users</title> <%= ajax_scaffold_includes %> </head> <body><%= @content_for_layout %>
</body>
</html>另外别忘了创建model类
注意:数据库 页面meta 文件保存编码 必须都使用utf-8格式,否则会乱码!