Skip to content

Instantly share code, notes, and snippets.

@9876691
Created September 7, 2018 13:33
Show Gist options
  • Select an option

  • Save 9876691/71f64bec0fe6ee580d25bdf8bbee7fd4 to your computer and use it in GitHub Desktop.

Select an option

Save 9876691/71f64bec0fe6ee580d25bdf8bbee7fd4 to your computer and use it in GitHub Desktop.
class Bitcoins::IndexPage < MainLayout
needs addresses : Array(Tuple(String, String, String))
needs form : KeyPairForm
def content
render_key_pair_form(@form)
h1 "Your Bitcoin Addresses"
table class: "table" do
thead do
tr do
th "Label"
th "Public Address"
th "Balance"
end
end
tbody do
@addresses.each do |label, public_key, balance|
tr do
td label
td public_key
td balance
end
end
end
end
end
private def render_key_pair_form(f)
form_for Bitcoins::Create do
label_for f.label
text_input f.label
hidden_input f.public_key
hidden_input f.private_key
submit "Create Bitcoin Address", id: "create-address"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment