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

Ticket #3861: rjs_action_symbol.patch

File rjs_action_symbol.patch, 1.5 kB (added by rick@rickbradley.com, 3 years ago)

actionpack unit test and patch for this problem

  • actionpack/test/controller/new_render_test.rb

    old new  
    3030  def render_action_hello_world 
    3131    render :action => "hello_world" 
    3232  end 
     33 
     34  def render_action_hello_world_as_symbol 
     35    render :action => :hello_world 
     36  end 
    3337   
    3438  def render_text_hello_world 
    3539    render :text => "hello world" 
     
    282286    assert_template "test/hello_world" 
    283287  end 
    284288 
     289  def test_do_with_render_action_as_symbol 
     290    get :render_action_hello_world_as_symbol 
     291    assert_template "test/hello_world" 
     292  end 
     293 
    285294  def test_do_with_render_text 
    286295    get :render_text_hello_world 
    287296    assert_equal "hello world", @response.body 
  • actionpack/lib/action_controller/base.rb

    old new  
    979979 
    980980      def default_template_name(default_action_name = action_name) 
    981981        if default_action_name 
    982           default_action_name = default_action_name.dup 
     982          default_action_name = default_action_name.to_s.dup 
    983983          strip_out_controller!(default_action_name) if template_path_includes_controller?(default_action_name) 
    984984        end 
    985985        "#{self.class.controller_path}/#{default_action_name}"