From: Thijs De vries Date: 2013-01-22T04:48:00+09:00 Subject: Weird send behavior in 1.9 Hey Guys, I used to have the following code: <%= form_for @something do |f| %> <%= f.send :select, :state, [['AL', 'Alabama'], ['AK', 'Alaska'] #etc %> <% end %> When I run this I get an exception because the kernel module method select gets called expecting an array for the first arg but gets the symbol :state instead. This is strange because f (an instance of ActionView::Helpers::FormBuilder) has this method defined publicly. Looking at the rails code, it does not seem that anything fancy is being done metaprogramming wise except for re-opening the class to define the select method on the ActionView:: Helpers::FormBuilder class. This is a public method and even if it was private, you would think that ruby would look from the closest class first (being the FormBuilder class) before looking up to the kernel module. Does anyone have any good documentation on the rules for ruby send on how it determines which method gets called? The above issue can be reproduced with rails 3.2.10 and ruby 1.9.3 patch level 327. Thijs -- Posted via http://www.ruby-forum.com/.