Skip to content

Instantly share code, notes, and snippets.

@mrchrisadams
Created September 25, 2008 11:17
Show Gist options
  • Save mrchrisadams/12803 to your computer and use it in GitHub Desktop.
Save mrchrisadams/12803 to your computer and use it in GitHub Desktop.
## This helper should return an image for each bank, depending on the value of current
def show_bank_logo(current)
case current
when /barclay/
logo_image = 'barclays'
when /coop/
logo_image = 'cooperative'
when /hsbc/
logo_image = 'hsbc'
when /rbs/
logo_image = 'rbs'
when /triodos/
logo_image = 'triodos'
end
<img id=\"fact_bank_logo\" src=\"/images/money/#{logo_image}.gif\" />"
end
#########################################################################
#### I'm assuming this would be called like this in an rhtml file:
<%= show_bank_logo(current) %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment