KTU
1
is it possible to have includes on controllers ?
ie. I have this block on many controller actions and I would like to
make it as DRY as possible
require ‘rubygems’
require ‘net/ldap’
require ‘iconv’
ldap = Net::LDAP.new :host => ‘ldap’,
:port => 389,
:auth => {
:method => :anonymous
}
KTU
2
On 13 Feb 2008, at 22:01, KTU wrote:
ldap = Net::LDAP.new :host => ‘ldap’,
:port => 389,
:auth => {
:method => :anonymous
}
controllers are just normal objects so yes. If it was me doing this,
i’d probably go the way of a wrapper class around Net::LDAP
Fred