Forum: Ruby on Rails How to call a standard function from a class inside the lib

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.
oo00oo (Guest)
on 2006-02-10 01:13
(Received via mailing list)
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails
Kent S. (Guest)
on 2006-02-10 01:38
(Received via mailing list)
There is no such thing as a standard function. url_for method belongs
to ActionController::Base class. So you can pass a reference of your
controller to your mytest method like

class Test
  def self.mytest controller, options
     url = controller.url_for( options )
  end
end

Kent.
oo00oo (Guest)
on 2006-02-10 17:34
(Received via mailing list)
Ok, thanks. Not easy to use lib finally
This topic is locked and can not be replied to.