On Thu, Dec 28, 2017 at 1:37 PM, Craig Russell <apache....@gmail.com> wrote:
> Dropping helpers. made it work.
>
> So is helpers a magic ruby thing? I read about ApplicationHelper but that's 
> not directly applicable.

Instead of multiple inheritance, Ruby has single inheritance
classes... and modules.  Sinatra defines a module called
Sinatra::Helpers that is included in each view, and provides a
convenient syntax for you to add methods to that module.  You should
be able to achieve the same effect (with less magic) by adding methods
directly to Sinatra::Helpers, thus:

module Sinatra::Helpers
  def pmcs
    ASF::Committee.pmcs.map(&:name).sort
  end
  def ppmcs
    ASF::Podling.list
    .select {|podling| podling.status == 'current'}
    .map(&:name).sort
  end
end

> Craig

- Sam Ruby

>> On Dec 28, 2017, at 4:11 AM, Sam Ruby <ru...@intertwingly.net> wrote:
>>
>>>
>>>
>>>  # get a complete list of PMC and PPMC names
>>>  @pmcs = helpers.pmcs()
>>
>> Drop 'helpers.'
>>
>>> Any idea how to make this work?
>>>
>>> Craig
>>
>> - Sam Ruby
>
> Craig L Russell
> Secretary, Apache Software Foundation
> c...@apache.org http://db.apache.org/jdo
>

Reply via email to