惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
H
Heimdal Security Blog
K
Kaspersky official blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Schneier on Security
G
GRAHAM CLULEY
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
C
Cisco Blogs
Cyberwarzone
Cyberwarzone
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
Security Archives - TechRepublic
Security Archives - TechRepublic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 司徒正美
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
V
Visual Studio Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Jina AI
Jina AI
P
Proofpoint News Feed
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog
IT之家
IT之家
S
Security Affairs
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
N
News | PayPal Newsroom
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
NISL@THU
NISL@THU

博客园 - Hi Jew

IDL实现的元胞自动机模型 Conway Life Game 随笔 Rails 语法笔记 - Hi Jew BizTalk Server : 提高 BizTalk 编程能力的 8 点技巧和窍门 Update SQL Server database with Updategrams 深入biztalk中sql adapter Ivar Jacobson .net如何连接oracle数据库 怎样用Codematic 连接Oracle数据库 数据库连接字符串大全 ASP.NET2.0 Provider模型(上) ——原理、模型与分析 什么是J2EE .net 和 j2ee的区别 IIS5.0和IIS6.0 Apache 或者 Apache.exe Oracle.EXE JAVA虚拟机 JAVA.exe进程 Windows XP/2003系统服务优化 安装Windows server 2003系统后无法安装显卡驱动的解决办法 (转载)
Cart creation 中的Ruby session问题
Hi Jew · 2008-08-19 · via 博客园 - Hi Jew

刚开始学Ruby On Rails 看的是那本经典的 Agile Web Development...
我用的是rails 2.0.2
在cart creation一章中我写的所有的代码都没有问题,除了开始的错误是“页面无法找到”。
上网查了一下说是用如下的解决方式即加上两行代码
"model :cart
model :line_item"

如下:

# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
 
 
  helper :all # include all helpers, all the time

  # See ActionController::RequestForgeryProtection for details
  # Uncomment the :secret if you're not using the cookie session store
  protect_from_forgery # :secret => '00df83fd9a7c900f90067f3893d03eb7'\

 
  model :cart
  model :line_item

end

可是再次运行就报了这么一个错误:

NoMethodError
undefined method `model' for ApplicationController:Class

RAILS_ROOT: E:/temp/demoNetBean