Skip to content
This repository has been 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 opened this issue Jul 17, 2018 · 0 comments
Open

children method should respond to to_proc and render #268

catmando opened this issue Jul 17, 2018 · 0 comments

Comments

@catmando
Copy link
Contributor

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
catmando added a commit that referenced this issue Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant