Last active
November 11, 2019 19:34
-
-
Save rx/57f94f0609b9d244153d77bca25f9263 to your computer and use it in GitHub Desktop.
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
Voom::Presenters.define(:test_page) do # Registers the presenter named `test_page` | |
content id: :hello_world do # Provides a content block wrapper with id :hello_world | |
heading6 "Hello World! #{Time.now}" # Displays the text as a level 6 heading | |
end | |
button :click_me do # Defines a button `CLICK ME` | |
event :click do # Listens for a `click` event on the button | |
snackbar 'hello world again!' # Displays the text in the snackbar at the bottom of the screen | |
inserts :hello_world, presenters_url(:hello_world2) # Inserts the contents of the presenter named `hello_world2` into the content block with id: `hello_world` | |
end | |
end | |
end | |
Voom::Presenters.define(:hello_world2) do # Registers the presenter named `hello_world2` | |
heading1 "I said Hello World!! #{Time.now}" # Display the text as a level 1 (big) heading | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment