Skip to content

Instantly share code, notes, and snippets.

Created June 12, 2012 16:11
Show Gist options
  • Save anonymous/2918447 to your computer and use it in GitHub Desktop.
Save anonymous/2918447 to your computer and use it in GitHub Desktop.
class CreditCard < ActiveRecord::Base
attr_accessible :bank, :benefit_earn_rate, :benefit_type, :benefit_value, :interest, :name, :brand,
:goal_name, :goal_cost, :goal_value
@goal = @credit_cards.goal_cost.to_f / @credit_cards.goal_value.to_f
end
<% @credit_cards.each do |credit_card| %>
<tr>
<td><%= credit_card.name %></td>
<td><%= credit_card.bank %></td>
<td><%= credit_card.brand %></td>
<td><%= credit_card.interest %></td>
<td><%= credit_card.benefit_type %></td>
<td><%= credit_card.benefit_earn_rate %></td>
<td><%= @goal %></td>
<td><%= credit_card.goal_name %></td>
<td><%= credit_card.goal_cost %></td>
<td><%= credit_card.goal_value %></td>
<td><%= link_to 'Show', credit_card %></td>
<td><%= link_to 'Edit', edit_credit_card_path(credit_card) %></td>
<td><%= link_to 'Destroy', credit_card, confirm: 'Are you sure?', method: :delete %></td>
</tr>
<% end %>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment