logo       

Re: Re: RESTful mixin, mixin repo?: msg#00017

lang.ruby.camping.general

Subject: Re: Re: RESTful mixin, mixin repo?

On 14/11/06, Mark Fredrickson
<mark.m.fredrickson-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote:
> I'd be happy to include this on the wiki. Can some explain how to add
> a helper function into the including module's namespace?
>
> eg. How do I get
>
> module Camping
> module REST
> module Helpers
> def form ...
> end
> end
> end
> end
>
> properly mixed in (so as to provide a form helper to override markaby)
> using 'include Camping::REST'

You'll have to use the included callback.

like :

module REST
def self.included(app)
app::Helpers.send :include, Helpers
end
end

--
Cheers,
zimbatm

http://zimbatm.oree.ch


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise