【发布时间】:2010-10-16 20:27:45
【问题描述】:
在我看来嵌入的 ruby 代码是……
<p id="notice"><%= notice %></p>
但是当 URL 读取时...
http://0.0.0.0:3000/projects/3?notice=Project+was+successfully+created
生成的 HTML 是...
<p id="notice"></p>
我期待它阅读......
<p id="notice">Project was successfully created</p>
什么给了?
编辑:这是我的控制器代码,只是为了缓解任何好奇心..
def create
@project = Project.new(params[:project])
respond_to do |format|
if @project.save
format.html { redirect_to(:action => "show", :id => @project, :notice => 'Project was successfully created.') }
format.xml { render :xml => @project, :status => :created, :location => @project }
else
format.html { render :action => "new" }
format.xml { render :xml => @project.errors, :status => :unprocessable_entity }
end
end
end
非常感谢!
【问题讨论】:
标签: ruby-on-rails notifications query-string