Where are those defined?


#1

Hi guys, anyone knows where are the get / put method you use in
functional
controllers test defined? I mean, grep cannot find them :frowning:

I basically need the documentation for put.

Thanks
Duncan


#2

Duncan Mac-Vicar wrote:

Hi guys, anyone knows where are the get / put method you use in
functional controllers test defined? I mean, grep cannot find them :frowning:

I basically need the documentation for put.

actionpack-1.11.2/lib/action_controller/test_process.rb has this:

%w( get post put delete head ).each do |method|
class_eval <<-EOV, FILE, LINE
def #{method}(action, parameters = nil, session = nil, flash =
nil)
@request.env[‘REQUEST_METHOD’] = “#{method.upcase}” if @request
process(action, parameters, session, flash)
end
EOV
end

Not the most enlightening code, but it does go to show how powerful Ruby
is.


#3

Thanks Alex!