Skip to content

Instantly share code, notes, and snippets.

@mazikwyry
Last active March 15, 2017 10:12
Show Gist options
  • Select an option

  • Save mazikwyry/63d6a0ca02393978ac52771a2300b2ce to your computer and use it in GitHub Desktop.

Select an option

Save mazikwyry/63d6a0ca02393978ac52771a2300b2ce to your computer and use it in GitHub Desktop.
class HelloWorld < React::Component::Base
param :time, type: Time
render do
p do
span { "Hello, " }
input(type: :text, placeholder: "Your Name Here")
span { "! It is #{params.time}"}
button(type: :button) { "login!" }.on(:click) do
login!
end if valid_new_input?
end
end
end
every(1) do
Element["#example"].render do
HelloWorld(time: Time.now)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment