Skip to content

Instantly share code, notes, and snippets.

@tgraham
Created July 4, 2011 03:40
Show Gist options
  • Save tgraham/1062886 to your computer and use it in GitHub Desktop.
Save tgraham/1062886 to your computer and use it in GitHub Desktop.
- ['stock', 'bond'].each do |fund_type|
- for fund in allocation.funds.find_all {|funds| funds.type == fund_type} do
%tr
%td= fund.type.humanize[0]
%td
- if (allocation.type == 'recommended') && (!current_user.admin?)
= truncate(fund.name)
- else
= link_to truncate(fund.name), "#edit_fund_#{allocation.funds.index(fund)}", class: 'nyroModal'
%td= fund.more_fields
%td
- if (allocation.type == 'recommended') && (current_user.admin?)
= link_to image_tag('/images/delete.png'), [allocation, fund], confirm: 'Are you sure?', method: :delete, class: 'delete'
- elsif (allocation.type == 'custom') && (!current_user.admin?)
= link_to image_tag('/images/delete.png'), [allocation, fund], confirm: 'Are you sure?', method: :delete, class: 'delete'
%div{id: "edit_fund_#{allocation.funds.index(fund)}", class: 'hidden'}
= render 'funds/edit', fund: fund
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment