Last active
September 7, 2018 13:39
-
-
Save 9876691/bc9be5550e3e3f301fff7bf61261d847 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::Create < BrowserAction | |
route do | |
KeyPairForm.create(params, user_id: current_user.id) do |form, key_pair| | |
if key_pair | |
flash.info = "Bitcoin address successfully generated" | |
redirect to: Bitcoins::Index | |
else | |
flash.danger = "Unable to generate Bitcoin Address, Please try again." | |
addresses = KeyPairQuery.new.user_id(current_user.id).map{ |keypair| | |
{ keypair.label, keypair.public_key, "" } | |
} | |
render IndexPage, form: form, addresses: addresses | |
end | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment