diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-20 03:32:28 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-20 03:32:28 +0000 |
commit | 4e7c6f58fb14ad8783062303191eebed7699965b (patch) | |
tree | c88321c7d094d0419f4e7fb7b418b65b7e1fec64 /actionpack | |
parent | f49ba114dbb330c1865682c111a9ba372cb40bda (diff) | |
download | rails-4e7c6f58fb14ad8783062303191eebed7699965b.tar.gz rails-4e7c6f58fb14ad8783062303191eebed7699965b.tar.bz2 rails-4e7c6f58fb14ad8783062303191eebed7699965b.zip |
Added option to String#camelize to generate lower-cased camel case by passing in :lower, like "super_man".camelize(:lower) # => "superMan" [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3986 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/prototype_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 3d15f2ecfd..efa3e7a14a 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -738,7 +738,7 @@ module ActionView if method.to_s =~ /(.*)=$/ assign($1, arguments.first) else - call("#{method.to_s.first}#{method.to_s.camelize[1..-1]}", *arguments) + call("#{method.to_s.camelize(:lower)}", *arguments) end end @@ -865,7 +865,7 @@ module ActionView method_args = arguments_for_call options[:method_args] # foo, bar, function method_args << ', ' unless method_args.blank? add_variable_assignment!(options[:variable]) if options[:variable] - append_enumerable_function!("#{enumerable.to_s.first}#{enumerable.to_s.camelize[1..-1]}(#{method_args}function(#{yield_args}) {") + append_enumerable_function!("#{enumerable.to_s.camelize(:lower)}(#{method_args}function(#{yield_args}) {") # only yield as many params as were passed in the block yield *options[:yield_args].collect { |p| JavaScriptVariableProxy.new(@generator, p) }[0..block.arity-1] add_return_statement! if options[:return] |