Skip to content

Instantly share code, notes, and snippets.

@blahutka
Last active November 3, 2017 11:36
Show Gist options
  • Save blahutka/7c2b928607fe54b0a0f8e9f540967352 to your computer and use it in GitHub Desktop.
Save blahutka/7c2b928607fe54b0a0f8e9f540967352 to your computer and use it in GitHub Desktop.
Render from array
# RENDERING FROM ARRAY
# This works
render(DIV) do
@img = Sem.Image(size: 'small', src: 'http://via.placeholder.com/140x100').on(:click) {alert('ok') }
[
@img,
span{'text'}
]
end
# This doesn't wrok
# render from params
param components: [ Sem.Image(size: 'small', src: 'http://via.placeholder.com/140x100'), span{'text'}, span{'text'} ]
render(DIV) do
params.components
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment