Created
July 4, 2011 03:40
-
-
Save tgraham/1062886 to your computer and use it in GitHub Desktop.
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
- ['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