Changeset 2747
- Timestamp:
- 10/26/05 13:14:10 (3 years ago)
- Author:
- david
- Message:
Added a reader for flash.now, so it's possible to do stuff like flash.now[:alert]
= 'New if not set' (closes #2422) [Caio Chassot]
- Files:
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/flash.rb (modified) (1 diff)
- trunk/actionpack/test/controller/flash_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r2737 r2747 1 *SVN* 2 3 * Added a reader for flash.now, so it's possible to do stuff like flash.now[:alert] ||= 'New if not set' #2422 [Caio Chassot] 4 5 1 6 *1.10.2* (October 26th, 2005) 2 7 trunk/actionpack/lib/action_controller/flash.rb
r2722 r2747 40 40 @flash.discard(k) 41 41 v 42 end 43 44 def [](k) 45 @flash[k] 42 46 end 43 47 end trunk/actionpack/test/controller/flash_test.rb
r1915 r2747 10 10 def set_flash_now 11 11 flash.now["that"] = "hello" 12 flash.now["foo"] ||= "bar" 13 flash.now["foo"] ||= "err" 14 @flashy = flash.now["that"] 12 15 @flash_copy = {}.update flash 13 16 render :inline => "hello" … … 76 79 response = process_request 77 80 assert_equal "hello", response.template.assigns["flash_copy"]["that"] 81 assert_equal "bar" , response.template.assigns["flash_copy"]["foo"] 82 assert_equal "hello", response.template.assigns["flashy"] 78 83 79 84 @request.action = "attempt_to_use_flash_now" 80 85 first_response = process_request 81 86 assert_nil first_response.template.assigns["flash_copy"]["that"] 87 assert_nil first_response.template.assigns["flash_copy"]["foo"] 82 88 assert_nil first_response.template.assigns["flashy"] 83 89 end
Download in other formats:
Powered by Trac 0.10.5dev
By Edgewall Software.Visit the Ruby on Rails project at
http://rubyonrails.org/