On 13 Feb 2008, at 22:01, KTU wrote:
>
> 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
> }
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---