-
-
Save machuga/2714960 to your computer and use it in GitHub Desktop.
Horrible rails controller method, need help
This file contains 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
[{:active=>"no", :start=>Tue, 15 May 2012 20:42:17 UTC +00:00, :amount=>"10.00", :card_type=>"Visa", :card_number=>"0195"}] | |
<p>Get this output at the end of my .each</p> |
This file contains 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
def get_payment_history | |
history = [] | |
@payments.each do |p| | |
response = Rails.application.config.payment_gateway.status_recurring(p.profile_id) | |
history << response.params.merge({ start: p.created_at }) if response.success? | |
end | |
history | |
end |
This file contains 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
= @history.each do |h| | |
.row | |
.three.columns | |
= h[:active] | |
.three.columns | |
= h[:start].strftime("%b %d, %Y") | |
.two.columns | |
= h[:amount] | |
.two.columns | |
= h[:card_type] | |
.two.columns | |
= h[:card_number] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment