Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 7776

Show
Ignore:
Timestamp:
10/07/07 19:12:02 (1 year ago)
Author:
bitsweat
Message:

Fix url_for, redirect_to, etc. with :controller => :symbol instead of 'string'. Closes #8562, #9525.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r7756 r7776  
    11*SVN* 
     2 
     3* Fix url_for, redirect_to, etc. with :controller => :symbol instead of 'string'.  #8562, #9525 [Justin Lynn, Tarmo TÀnav, shoe] 
    24 
    35* Use #require_library_or_gem to load the memcache library for the MemCache session and fragment cache stores.  Closes #8662. [Rick] 
  • trunk/actionpack/lib/action_controller/assertions/response_assertions.rb

    r7580 r7776  
    7070 
    7171              if value.respond_to?(:[]) && value['controller'] 
     72                value['controller'] = value['controller'].to_s 
    7273                if key == :actual && value['controller'].first != '/' && !value['controller'].include?('/') 
    7374                  new_controller_path = ActionController::Routing.controller_relative_to(value['controller'], @controller.class.controller_path) 
  • trunk/actionpack/lib/action_controller/routing.rb

    r7724 r7776  
    13261326        expire_on = build_expiry(options, recall) 
    13271327 
     1328        if options[:controller] 
     1329          options[:controller] = options[:controller].to_s 
     1330        end 
    13281331        # if the controller has changed, make sure it changes relative to the 
    13291332        # current controller module, if any. In other words, if we're currently 
  • trunk/actionpack/test/controller/action_pack_assertions_test.rb

    r7403 r7776  
    1919 
    2020  def redirect_to_controller() redirect_to :controller => "elsewhere", :action => "flash_me"; end 
     21 
     22  def redirect_to_controller_with_symbol() redirect_to :controller => :elsewhere, :action => :flash_me; end 
    2123 
    2224  def redirect_to_path() redirect_to '/some/path' end 
     
    430432  end 
    431433 
     434  def test_assert_redirection_with_symbol 
     435    process :redirect_to_controller_with_symbol 
     436    assert_nothing_raised { 
     437      assert_redirected_to :controller => "elsewhere", :action => "flash_me" 
     438    } 
     439    process :redirect_to_controller_with_symbol 
     440    assert_nothing_raised { 
     441      assert_redirected_to :controller => :elsewhere, :action => :flash_me 
     442    } 
     443  end 
     444 
    432445  def test_redirected_to_with_nested_controller 
    433446    @controller = Admin::InnerModuleController.new 
  • trunk/actionpack/test/controller/url_rewriter_test.rb

    r7501 r7776  
    235235  end 
    236236 
     237  def test_path_generation_for_symbol_parameter_keys 
     238    assert_generates("/image", :controller=> :image) 
     239  end 
     240 
    237241  private 
    238242    def extract_params(url)