Sha256: 89dcabf89aa5d795f0af642f28521e6edab6a43fc816fb7379a9cbe80e6560e7
Contents?: true
Size: 486 Bytes
Versions: 25
Compression:
Stored size: 486 Bytes
Contents
# app/views/components/app.rb class App < React::Component::Base def add_new_word # for fun we will use setgetgo.com to get random words! HTTP.get("http://randomword.setgetgo.com/get.php", dataType: :jsonp) do |response| Word.new(text: response.json[:Word]).save end end render(DIV) do SPAN { "Count of Words: #{Word.count}" } BUTTON { "add another" }.on(:click) { add_new_word } UL do Word.each { |word| LI { word.text } } end end end
Version data entries
25 entries across 7 versions & 1 rubygems