Skip to content

Commit

Permalink
Make RJS treat symbolic action names nicely #3861 [Rick Olson]
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Feb 17, 2006
1 parent e8c4cc9 commit 1812dbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_controller/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ def assert_existance_of_template_file(template_name)

def default_template_name(default_action_name = action_name)
if default_action_name
default_action_name = default_action_name.dup
default_action_name = default_action_name.to_s.dup
strip_out_controller!(default_action_name) if template_path_includes_controller?(default_action_name)
end
"#{self.class.controller_path}/#{default_action_name}"
Expand Down
9 changes: 9 additions & 0 deletions actionpack/test/controller/new_render_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def render_hello_world_from_variable
def render_action_hello_world
render :action => "hello_world"
end

def render_action_hello_world_as_symbol
render :action => :hello_world
end

def render_text_hello_world
render :text => "hello world"
Expand Down Expand Up @@ -282,6 +286,11 @@ def test_do_with_render_action
assert_template "test/hello_world"
end

def test_do_with_render_action_as_symbol
get :render_action_hello_world_as_symbol
assert_template "test/hello_world"
end

def test_do_with_render_text
get :render_text_hello_world
assert_equal "hello world", @response.body
Expand Down

0 comments on commit 1812dbb

Please sign in to comment.