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

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - 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