Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

children method should respond to to_proc and render #268

Open
@catmando

Description

@catmando

For example

# add the class funky to any DIV
class FunkyDiv < Hyperloop::Component
  collect_all_other_params_as :opts
  render do
    opts = params.opts.dup
    opts[:class] = "funky #{opts[:class]}"
    DIV(opts, &children)  # &children ==> children.to_proc
    # rather than 
    # { children.each &:render }
  end
end

class TableWithHeader < Hyperloop::Component
  render do
    TABLE do 
      TH { ... }
      children.render
     end
   end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions