Getting input''s value from a form

Keaja
Wed, 27 Feb 2008 17:09:50 -0000

I am following a new tutorial just added to the upcoming book,
Advanced Rails Recipes. The recipe is, "Process Recurring Credit Card
Payments". The tutorial is great and I recommend picking up the PDF
book.


Simply put, there is a card server, and a then your main application
which is used to pass credit card numbers to the server.

The problem I am having, is how do I get the parameters from the form
into  the controller without storing them in the  model? It would be
easy if I was storing the credit card number and expiration date in
the user model, but I am not for security, so I cannot call
@user.credit_card number. I guess I need something like
page["input_credit_card].value?

    if @user.save
      self.current_user = @user
      cc = CreditCard.create(:first_name => @user.first_name,
        :last_name => @user.last_name,
        :number => #pick up from the form,
        :month => #pick up from the form,
        :year => #pick up from the form,
        :brand => #pickup from the form
      )