I'm kind of new on Ruby on Rails and I have a little problem: 
I have three classes (upgrade, credit\_card and user), and, as a User, I need to insert my credit cards to buy an upgrade. All my classes are working properly. But the problem is that I need to get all the credit cards numbers that the user had already inserted and put them into the Upgrade.form (using a select box or anything else) as an array, so one of them can be selected. So, I wanted to bring all the credit cards information to one variable:

```
    class Upgrade < ActiveRecord::Base
      attr_accessible :account_plan, :credit_card
      has_one :credit_card
      belongs_to :user

      CREDIT_CARD_GETTER = current_user.credit_card
    end

```

Then, I want to to use this on my select box. On the form page:

```
   <div class="field">
    <%= f.label "Choose your Credit Card*" %><br />
    <%= f.select :credit_card, #<%= current_user.credit_card.number %> %>

```

What should I do? Is it right? Sorry I'm a newbie on ruby.
Thanks!

**UPDATE**

For helping, I'm updating the codes, and put them all here. I want to show the Credit Card Number as an option.

UPGRADE index
 My Account Plans:

 Plano de Compra

```
    <% @upgrades.each do |upgrade| %>
    <tr>
    <td><%= upgrade.account_plan %></td>
    <td><%= link_to 'Destroy', upgrade, method: :delete, data: { confirm: 'Are you sure?' } %></td>
    </tr>
    <% end %>
    </table>

    <br />

```

Upgrade Model

```
    class Upgrade < ActiveRecord::Base
    attr_accessible :account_plan, :credit_card
    belongs_to :user 
    has_many :credit_cards
    end

```

User Model

```
    class User < ActiveRecord::Base        
    has_many :credit_cards
    has_many :upgrades

```

Credit Card form

```
    <div class="field">
    <%= f.label "Flag" %><br />
    <%= f.select :flag,   [['American Express', '1'],['VISA', '2'],['Dinners', '3'],   ['MasterCard', '4']] %>
    </div><br>
    <div class="field">
    <%= f.label "Nome no Cartão" %><br />
    <%= f.text_field :name, :class => "span3"%>
    </div>
    <div class="field">
    <%= f.label "Card Number" %><br />
    <%= f.text_field :number, :class => "span3"%>
    </div>
    <div class="field">
    <%= f.label "Data de Validade" %><br />
    <%= f.text_field :date %>
    </div>
    <div class="field">
    <%= f.label "Sec. Code" %><br />
    <%= f.text_field :seg_cod, :class => "span1"%>
    </div>
    <div class="actions">
    <%= f.submit %>
    </div>
    <% end %>

```

Credit Card Model

```
    class CreditCard < ActiveRecord::Base
    attr_accessible :date, :flag, :name, :number, :seg_cod
    validates_presence_of :date, :flag, :name, :number, :seg_cod, presence => true
    belongs_to :upgrade
    belongs_to :user
    end

```