Last active
November 3, 2017 11:36
-
-
Save blahutka/7c2b928607fe54b0a0f8e9f540967352 to your computer and use it in GitHub Desktop.
Render from array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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