every 1 do @time = Time.now update_dom end end def render div class: 'clock' do text @time.strftime('%r') end end end $document.ready do Clock.new.mount_to($document['clock']) end
navbar-default' do div class: 'container' do div class: 'navbar-header' do span class: 'navbar-brand' do text 'Inesita' end ul class: 'nav navbar-nav' do li class: "#{"active" if router.current_url?(:description)}" do a href: router.url_for(:description) do text 'Description' end end end end end end end end
fetch_repos Browser::HTTP.get 'https://api.github.com/repositories' do |req| req.on :success do |res| @repos = res.json update_dom end end end def repos @repos end end