Changeset 1223
- Timestamp:
- 04/19/05 10:26:03 (3 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/assertions.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/base.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r1221 r1223 1 1 *SVN* 2 3 * Fixed stringification on all assigned hashes. The sacrifice is that assigns[:person] won't work in testing. Instead assigns["person"] or assigns(:person) must be used. In other words, the keys of assigns stay strings but we've added a method-based accessor to appease the need for symbols. 2 4 3 5 * Fixed that rendering a template would require a connection to the database #1146 trunk/actionpack/lib/action_controller/assertions.rb
r1216 r1223 15 15 # These collections can be used just like any other hash: 16 16 # 17 # assert_not_nil assigns [:person]# makes sure that a @person instance variable was set17 # assert_not_nil assigns(:person) # makes sure that a @person instance variable was set 18 18 # assert_equal "Dave", cookies[:name] # makes sure that a cookie called :name was set as "Dave" 19 19 # assert flash.empty? # makes sure that there's nothing in the flash 20 # 21 # For historic reasons, the assigns hash uses string-based keys. So assigns[:person] won't work, but assigns["person"] will. To 22 # appease our yearning for symbols, though, an alternative accessor has been deviced using a method call instead of index referencing. 23 # So assigns(:person) will work just like assigns["person"], but again, assigns[:person] will not work. 20 24 # 21 25 # On top of the collections, you have the complete url that a given action redirected to available in redirect_to_url. trunk/actionpack/lib/action_view/base.rb
r1189 r1223 158 158 159 159 def initialize(base_path = nil, assigns_for_first_render = {}, controller = nil)#:nodoc: 160 @base_path, @assigns = base_path, assigns_for_first_render .with_indifferent_access160 @base_path, @assigns = base_path, assigns_for_first_render 161 161 @controller = controller 162 162 end