- 浏览: 41675 次
- 性别:
- 来自: 大连
文章分类
最新评论
-
wangluo19:
刚刚好解决了我的问题,原来session factory可以把 ...
hibernate annotations和hbm.xml配置文件并存配置 -
vivei:
能者为师
ruby 1,9 多字节字符
rails3请求之后,flash内容没有被清除?
flash经常用在controller, 与view中,用来传递与表示信息,通常有修改记录成功,表示一些错误提示内容等。
flash在两个action中传递临时对象,之后,再被清除
理论上是这样的吧,事实上有时你会发现flash内容没有被清除,而且还会在不只一次次的请求中表现出来,现在这样的情况的原因,很简单就是flash的内容没有被清掉了。
如果你想flash的内容这样约定:
(1)flash在两个action之间进行传递,使用flash[] =
(2)flash仅在当前的action中有效,并在当前action执行后,消失,使用flash.now[]=
ruby on rails help pages
"When you need to pass an object to the next action, you use the standard flash assign ([]=). When you need to pass an object to the current action, you use now, and your object will vanish when the current action is done."
总结起来,可以这么使用
flash[:notice] with redirects (e.g. redirect_to :action => 'something') flash.now[:notice] with renders (i.e. render :action => 'something')
[1]:http://ariejan.net/2007/09/26/flash-not-clearing-after-a-request/
[2]:http://www.rornoob.com/a/rails-flash-not-clearing/
发表评论
-
rails 开源blog typo
2011-12-26 16:23 628rails open source blog: htt ... -
ROR网站
2011-07-07 10:56 857# gems http://rubygems.org/ ... -
Rail3 Plugs
2011-02-11 11:24 669Rails3 Plugs Gemfile [1] t ... -
rails3 update_all 使用:order, :limit条件时,忽略条件问题
2011-02-11 11:08 1252这个bug是在使用delay_job(2.1.2)查出来的,后 ... -
Notifications in Rails 3
2011-02-11 10:34 991249: Notifications in Rails 3 ... -
rails3 jquery ajax
2011-01-30 14:56 2459rails3中使用非form提交的ajax操作,这里使用的js ... -
插件扩展(2)
2011-01-28 16:41 757ruby:1.9.2 rails3.0.3 学习编写 ... -
插件扩展
2011-01-28 11:24 735在ruby on rails3 的guides,插件扩展中有这 ... -
关于restful_authentication密码更新问题
2011-01-05 22:28 1008使用restful_authentication插件时,进行更 ... -
rails3 更新时间问题
2010-12-18 21:52 1192rails3 更新时间问题(updated_at) (未完) ... -
Ruby基本数据类型
2010-12-09 08:55 855d (转)http://blog.csdn.net/fore ... -
ruby 1,9 多字节字符
2010-12-08 08:53 923ruby 1.9 String类 length ... -
Here document
2010-12-07 08:55 716Here document 用于引入一段较复杂的内容, ... -
About Resouce
2010-12-02 21:40 778关于RESTful风格的URL设计 Singul ... -
Migration and Database Column Types
2010-11-30 23:09 865rails下迁移类与数据库类型对照表: M ... -
rails3 scope dead???
2010-11-29 18:37 1296看到一篇关于rails中是否还继续推荐使用scope的文章 ... -
Ruby Blocks
2010-11-22 08:41 809Ruby Blocks Block构成 ... -
each, map, collect
2010-11-22 08:38 722each, map, collect arr = ... -
使用cookie的session
2010-11-22 08:36 706使用cookie 的session 修改/depot/ ... -
Validation Helpers(数据验证)
2010-11-22 08:33 703validates_acceptance_of # c ...
相关推荐
Rails3教程系列 DRY(Dont Repeat Yourself) DRY(Dont Repeat Yourself) DRY(Dont Repeat Yourself) DRY(Dont Repeat Yourself) DRY(Dont Repeat Yourself) DRY(Dont Repeat Yourself) DRY(Dont Repeat Yourself) DRY...
Rails 3 in Action 2011年9月新鲜出炉,针对最新的Rails 3.1进行说明
Ruby+on+Rails+3+Tutorial.pdf 应用Rails进行敏捷Web开发第4版.pdf (Agile Web Development with Rails) Rails.Recipes.Rails.3.Edition.pdf
Windows7_Cygwin_Git_RVM_Ruby1.9.3_Rails3_MongoD B_Nginx_Unicorn_Rspec_Guard_Spork(2-Ruby on Rails3 安装配置
Rails3消息队列系统 Sidekiq
rails3的英文文档
Rails3的ActiveRecord 查询API.doc
turbo-sprockets-rails3, 加速你的Rails 3资产 用于 Rails 3.2.x的涡轮链轮 通过只根据源文件的哈希来重新编译已经更改的资产,从而加快 Rails 3 rake assets:precompile的速度只编译一次以生成指纹和非打印的资产...
rails常用命令,例如新建rails项目,新建controller、model 等等
3 rails # gem install rails -v=2.3.11 4 passenger # gem install passenger passenger-install-apache2-module 安装完成后按照提示将下面的内容添加到etc/httpd/httpd.conf LoadModule pa
The Rails™ 3 Way is a comprehensive resource that digs into the new features in Rails 3 and perhaps more importantly, the rationale behind them. —Yehuda Katz, Rails Core The Bible for Ruby on ...
cacheable-flash, 获取处理页cacheing的Rails Flash 对象 是一个新的希望这里 gem 不再被维护。 请考虑切换到 github.com/leonid-shevtsov/unobtrusive_flash 。这么长的时间,感谢你 ! CacheableFlash 描述这个...
ruby on rails开发的初学者很适合的工具书,易上手,很实用,
The Rails™ 3 Way is the only comprehensive, authoritative guide to delivering production-quality code with Rails 3. Pioneering Rails expert Obie Fernandez and a team of leading experts illuminate ...
This pioneering book is the first resource that deep dives into the new Rails 3 APIs and shows you how use them to write better web applications and make your day-to-day work with Rails more ...
基于java的开发源码-Rails3消息队列系统 Sidekiq.zip 基于java的开发源码-Rails3消息队列系统 Sidekiq.zip 基于java的开发源码-Rails3消息队列系统 Sidekiq.zip 基于java的开发源码-Rails3消息队列系统 Sidekiq.zip ...
jquery-rails, 一个 gem,用于自动使用jQuery和 Rails 3 railsjQuery 面向 Rails 如此伟大。这里 gem 提供:jQuery 1.7.2jQuery UI 1.8.18 ( 仅适用于 javascript )jQuery UJS适配器assert_select_j
ruby on rails文档,rails3入门指南
rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails ...