Created
September 7, 2018 13:33
-
-
Save 9876691/71f64bec0fe6ee580d25bdf8bbee7fd4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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