Changeset 9212
- Timestamp:
- 04/02/08 12:48:59 (3 months ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/prototype_helper.rb (modified) (1 diff)
- trunk/actionpack/test/controller/redirect_test.rb (modified) (2 diffs)
- trunk/actionpack/test/template/prototype_helper_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r9177 r9212 1 1 *SVN* 2 3 * Ensure RJS redirect_to doesn't html-escapes string argument. Closes #8546 [josh, eventualbuddha, Pratik] 2 4 3 5 * Support render :partial => collection of heterogeneous elements. #11491 [Zach Dennis] trunk/actionpack/lib/action_view/helpers/prototype_helper.rb
r9195 r9212 844 844 # page.redirect_to(:controller => 'account', :action => 'signup') 845 845 def redirect_to(location) 846 assign 'window.location.href', @context.url_for(location) 846 url = location.is_a?(String) ? location : @context.url_for(location) 847 record "window.location.href = #{url.inspect}" 847 848 end 848 849 trunk/actionpack/test/controller/redirect_test.rb
r8633 r9212 64 64 @hello = "world" 65 65 redirect_to :action => "hello_world" 66 end 67 68 def redirect_to_url 69 redirect_to "http://www.rubyonrails.org/" 70 end 71 72 def redirect_to_url_with_unescaped_query_string 73 redirect_to "http://dev.rubyonrails.org/query?status=new" 66 74 end 67 75 … … 194 202 end 195 203 204 def test_redirect_to_url 205 get :redirect_to_url 206 assert_response :redirect 207 assert_redirected_to "http://www.rubyonrails.org/" 208 end 209 210 def test_redirect_to_url_with_unescaped_query_string 211 get :redirect_to_url_with_unescaped_query_string 212 assert_response :redirect 213 assert_redirected_to "http://dev.rubyonrails.org/query?status=new" 214 end 215 196 216 def test_redirect_to_back 197 217 @request.env["HTTP_REFERER"] = "http://www.example.com/coming/from" trunk/actionpack/test/template/prototype_helper_test.rb
r8564 r9212 359 359 assert_equal 'window.location.href = "http://www.example.com/welcome";', 360 360 @generator.redirect_to(:action => 'welcome') 361 assert_equal 'window.location.href = "http://www.example.com/welcome?a=b&c=d";', 362 @generator.redirect_to("http://www.example.com/welcome?a=b&c=d") 361 363 end 362 364