mardi 16 janvier 2018

Helper view with multiple blocks

I want to create a nice helper, which looks like following (easy example, I want to make it much more complicated):

# in my haml-file

-mywidget do |widget|
  -widget.header do
    %h1 header
  -widget.body do
    Lorem Ipsum 123123...
  -widget.footer do
    footertext
  AdditionalContentWithoutBlock

I tried to create my own helper class, but was not successfull so far.. Anybody has a small example or link on how to create such block attributes?

Aucun commentaire:

Enregistrer un commentaire