Forum: Ruby on Rails where are those defined?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0b33eb41d6fe60c4cec417995295e2ba?d=identicon&s=25 Duncan Mac-Vicar (Guest)
on 2006-01-23 11:55
(Received via mailing list)
Hi guys, anyone knows where are the get / put method you use in
functional
controllers test defined? I mean, grep cannot find them :-(

I basically need the documentation for put.

Thanks
Duncan
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-01-23 12:59
(Received via mailing list)
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 :-(
>
> 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.
0b33eb41d6fe60c4cec417995295e2ba?d=identicon&s=25 Duncan Mac-Vicar (Guest)
on 2006-01-23 14:46
(Received via mailing list)
Thanks Alex!
This topic is locked and can not be replied to.